-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I'm trying to set the OpenAPI spec version to 3.0 for the time being, yet neither the delegate method nor the MSBuild method proposed in the docs are working.
I need it as 3.0 for the correct OpenAPI.json file to be generated, and have tried this:
Program.cs:
builder.Services.AddOpenApi(options =>
{
options.OpenApiVersion = OpenApiSpecVersion.OpenApi3_0;
});BackendService.csproj:
<PropertyGroup>
<OpenApiDocumentsDirectory>.</OpenApiDocumentsDirectory>
</PropertyGroup>
<ItemGroup>
<OpenApiGenerateDocumentsOptions Include="Options">
<Options>--openapi-version OpenApi3_0</Options>
</OpenApiGenerateDocumentsOptions>
</ItemGroup>Yet the generated OpenAPI.json is always version 3.1:
OpenAPI.json:
"openapi": "3.1.1",
"info": {
"title": "BackendService | v1",
"version": "1.0.0"
}
Any suggestions gladly appreciated!
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
.NET 10
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi