-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Microsoft.extensions.api description.server allow specifying environment #55836
Microsoft.extensions.api description.server allow specifying environment #55836
Conversation
@adityamandaleeka, may I please request a review on this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work because this just appends the --environment parameter to the dotnet-getdocument.dll command, which doesn't support the flag. I tested by using OpenApiGenerateDocumentsOptions tag as you can see in the code above can be used to accomplish appending the --environment parameter in the same way you are trying to do.
b88c6d5
to
da2374d
Compare
Thanks @JoasE, I have implemented the feedback, please let me know if that is fine. Many thanks |
...xtensions.ApiDescription.Server/src/build/Microsoft.Extensions.ApiDescription.Server.targets
Outdated
Show resolved
Hide resolved
…t) is not empty && Quoted the $(OpenApiGenerateEnvironment) value to handle cases where it contains spaces.
…erver-Allow-specifying---environment
...xtensions.ApiDescription.Server/src/build/Microsoft.Extensions.ApiDescription.Server.targets
Outdated
Show resolved
Hide resolved
….Extensions.ApiDescription.Server.targets Co-authored-by: Martin Costello <martin@martincostello.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posted a comment inline.
Also, I think there's more work involved here than I originally outlined in the issue.
We'll have to update the list of supported options in here and pipe the environment name through.
@@ -63,6 +63,10 @@ | |||
<_DotNetGetDocumentCommand>$(_DotNetGetDocumentCommand) $(OpenApiGenerateDocumentsOptions)</_DotNetGetDocumentCommand> | |||
</PropertyGroup> | |||
|
|||
<PropertyGroup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little bit nervous about pulling this out into a seperate property group since they are evaluated in order of appearance. I think it would make sense to tweak this a bit and include it in reference to _DotNetGeDocumentCommand
like so:
<_DotNetGetDocumentCommand Condition=" '$(OpenApiGenerateEnvironment)' != '' " >--environment "$(OpenApiGenerateEnvironment)"</_DotNetGetDocumentCommand>
Not stale |
You need to close and re-open the PR so that the CI re-runs: #55836 (comment) That's why the bot thinks the PR is stale. |
Thanks, I will do that. |
@MattyLeslie Do you have any thoughts on this feedback comment? |
Hello. I see that you've just added |
Hi @MattyLeslie. |
Add Support for Specifying Environment During Swagger Generation with OpenApiGenerateEnvironment MSBuild Property
This pull request adds support for specifying the environment used during Swagger document generation in ASP.NET Core projects. By introducing the
OpenApiGenerateEnvironment
MSBuild property, users can control the environment configuration used when generating Swagger documentation during the build process.Changes made:
OpenApiGenerateEnvironment
MSBuild PropertyFixes #54698