Skip to content

Conversation

ldsenow
Copy link

@ldsenow ldsenow commented Sep 28, 2025

Fixes #54698

This change adds support for the OpenApiGenerateEnvironment MSBuild property which allows specifying the environment name (e.g., Development, Production) when generating OpenAPI documents during build. This sets the ASPNETCORE_ENVIRONMENT environment variable when executing the application to generate documents.

Changes:

  • Added OpenApiGenerateEnvironment property to MSBuild props file
  • Updated MSBuild targets to pass --environment parameter to dotnet-getdocument
  • Updated dotnet-getdocument to accept and forward environment parameter
  • Updated GetDocument.Insider to pass environment to host factory
  • Added necessary resource strings for the new --environment option

…erver

Fixes dotnet#54698

This change adds support for the OpenApiGenerateEnvironment MSBuild property
which allows specifying the environment name (e.g., Development, Production)
when generating OpenAPI documents during build. This sets the ASPNETCORE_ENVIRONMENT
environment variable when executing the application to generate documents.

Changes:
- Added OpenApiGenerateEnvironment property to MSBuild props file
- Updated MSBuild targets to pass --environment parameter to dotnet-getdocument
- Updated dotnet-getdocument to accept and forward environment parameter
- Updated GetDocument.Insider to pass environment to host factory
- Added necessary resource strings for the new --environment option

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions github-actions bot added the area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI label Sep 28, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Sep 28, 2025
Copy link
Contributor

Thanks for your PR, @@ldsenow. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

Added tests to verify that the --environment parameter is properly
accepted and passed through the GetDocument tool chain.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-commandlinetools Includes: Command line tools, dotnet-dev-certs, dotnet-user-jwts, and OpenAPI community-contribution Indicates that the PR has been added by a community member feature-openapi
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Microsoft.Extensions.ApiDescription.Server: Allow specifying --environment
2 participants