Skip to content

WIP: API Client Generation#572

Open
sciku1 wants to merge 2 commits intoUniversalis-FFXIV:v2from
sciku1:feat/codegen-clients-2
Open

WIP: API Client Generation#572
sciku1 wants to merge 2 commits intoUniversalis-FFXIV:v2from
sciku1:feat/codegen-clients-2

Conversation

@sciku1
Copy link

@sciku1 sciku1 commented Apr 7, 2022

I added an example with python and javascript, in the Dockerfile during the swagger-codegen stage the libraries get created in the format /clients/{lang} so /clients/javascript and /clients/python are added for now (I haven't tested the JS one).

I ended up needing to make some dependencies be loaded by generator functions rather than in the initialization. For example
sc.AddSingleton<IMongoClient>(new MongoClient(configuration["MongoDbConnectionString"])); sc.AddSingleton<IMongoClient>(_ => new MongoClient(configuration["MongoDbConnectionString"]));

Effectively this just means the object will be created when it is retrieved from the container the first time. This is because the Swashbuckle.Cli needs to be able to run Startup.ConfigureServices, and in the scenario where the docker container may not have the configuration available (because the entrypoint isn't necessarily getting called if the container is being run.

sciku1 added 2 commits April 7, 2022 00:45
…etons to when they are used (rather than on application startup)
@karashiiro
Copy link
Member

Is this still WIP? A-OK if so, just wondering if that's deliberate or not.

@sciku1
Copy link
Author

sciku1 commented Apr 23, 2022

Hey sorry, it's working locally but it seems like the CI fails when downloading the image and I hadn't had time to debug it. WIll get to it this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants