From ASP.NET Core 10.0, the default OpenAPI version would be
3.1.x. Prior to ASP.NET Core 10.0, the
default OpenAPI version was 3.0.x for as
long as I could remember.
While this looks like a minor version bump, this is a significant update with
breaking changes. If you want to keep using OpenAPI version 3.0.x,
you can do so as follows:
builder.Services.AddOpenApi(x =>{
x.OpenApiVersion = Microsoft.OpenApi.OpenApiSpecVersion.OpenApi3_0;
});
If you are generating the OpenAPI document at build time, you can add the following MSBiild item.
<OpenApiGenerateDocumentsOptions>--openapi-version OpenApi3_0</OpenApiGenerateDocumentsOptions>
Hope this helps.
Regards,
Jaliya
Jaliya
No comments:
Post a Comment