-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CreateWebHostBuilderMethod & AspNetCoreEnvironment setting, implement UseDocumentProvider & DocumentName #1655
Conversation
src/NSwag.Commands/Commands/SwaggerGeneration/SwaggerGeneratorCommandBase.cs
Outdated
Show resolved
Hide resolved
src/NSwag.Commands/Commands/SwaggerGeneration/SwaggerGeneratorCommandBase.cs
Outdated
Show resolved
Hide resolved
@RSuter Sorry for being late, I was able to try this one a bit more in depth, so I will write my findings here: MsBuild integration
.ConfigureAppConfiguration((context, config) =>
{
config.SetBasePath(@"TheProperPath");
})
.UseStartup<Startup>();
Please note I'm using the copy @ReferencePaths trick in my csproj e.g. <Copy SourceFiles="@(ReferencePath)" DestinationFolder="$(OutDir)References" /> NSwagStudio
Setting the new field appropriately and the correct runtime, I was able to generate the swagger document! |
I think there is an option to set the working directory (WorkingDirectory setting?) - have you tried that? |
@RSuter yes, I've tried setting the correct location with:
But it still result in an exception (see message above) |
Im talking about the workingDirectory setting of the nswag cli |
Oh, sorry I didn't get that one, I can try again and get back to you |
I'll add the AspNetCoreEnvironment setting in the next hours, fix your suggestions and merge this PR |
👍 |
@ilmax ok, PR is ready and I now start running some integration tests with it... it should now completely cover your scenarios. Also see updated PR description. If possible, please test with the following settings:
If everything works as expected, we can merge. |
@RicoSuter How exactly do i use the setting :edit Ok nevermind, i see that proper auto discovery is already implemented hence CreateWebHostBuilder method should be called when using the default |
Closes #1654, closes #1698
Update: API slightly changed/Improved by PR #1714
Breaking changes:
/UseDocumentProvider:false
Usage of UseDocumentProvider: