-
Notifications
You must be signed in to change notification settings - Fork 24.6k
Documents the OpenApiGenerationEnvironment MSBuild property #37589
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
Changes from all commits
9f12612
9e1e6ef
9ccb26b
d6c073c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wadepickett For other features, it looks like we are not consistent in file names whether we use the preview version number in file name or not. Do you have recommendation?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Youssef1313, You are right, it is not consistant, thanks for pointing out the issue. I don't see a reason for keeping the preview versions in the file name for the What's new include files. I think they just started that way long ago at some point and then were perpetuated. I think even the current AI agent related to this is includijng them, which I'll fix. . Would become: I will fix all of them in a new PR after this one.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went ahead and fixed the new file name here. I will correct the rest of them in a new PR. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ### Select an environment for build-time OpenAPI document generation | ||
|
|
||
| Build-time OpenAPI document generation supports selecting the app environment with the `OpenApiGenerationEnvironment` MSBuild property. The property sets the host's environment for the generation process, equivalent to setting the `ASPNETCORE_ENVIRONMENT` or `DOTNET_ENVIRONMENT` environment variable. Environment-specific configuration and document transformations can therefore affect the generated OpenAPI document without requiring the environment variable to be set before running `dotnet build`. | ||
|
|
||
| Set the property in the project file: | ||
|
|
||
| ```xml | ||
| <PropertyGroup> | ||
| <OpenApiGenerationEnvironment>Development</OpenApiGenerationEnvironment> | ||
| </PropertyGroup> | ||
| ``` | ||
|
|
||
| For more information, see <xref:fundamentals/openapi/aspnetcore-openapi#customize-build-time-document-generation>. | ||
|
|
||
| Thank you [@ldsenow](https://github.com/ldsenow) for this contribution! |
Uh oh!
There was an error while loading. Please reload this page.