Skip to content

Conversation

@baywet
Copy link

@baywet baywet commented Feb 13, 2026

fixes #63754
a subsequent pull request(s) will be required to take advantage of the new capabilities like item schema for streaming events

@baywet baywet requested a review from a team as a code owner February 13, 2026 02:43
Copilot AI review requested due to automatic review settings February 13, 2026 02:43
@baywet baywet requested review from a team and wtgodbe as code owners February 13, 2026 02:43
@github-actions github-actions bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Feb 13, 2026
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 13, 2026
@dotnet-policy-service
Copy link
Contributor

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

"$ref": "#/components/schemas/NullableResponseModel"
}
]
],
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change in shape is due to a bugfix in the library microsoft/OpenAPI.NET#2645

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for OpenAPI 3.2.0 by upgrading the Microsoft.OpenApi NuGet packages from version 2.0.0 to 3.3.1 and updating the default OpenAPI specification version from 3.1 to 3.2. The PR makes necessary code adaptations to work with the upgraded library's API changes.

Changes:

  • Upgrades Microsoft.OpenApi and Microsoft.OpenApi.YamlReader packages from 2.0.0 to 3.3.1
  • Changes default OpenAPI specification version from OpenApi3_1 to OpenApi3_2
  • Adapts code to API changes in the library (Dictionary<string, OpenApiMediaType> → Dictionary<string, IOpenApiMediaType>)

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
eng/Versions.props Updates Microsoft.OpenApi package versions from 2.0.0 to 3.3.1
src/OpenApi/src/Services/OpenApiOptions.cs Changes default OpenAPI version from OpenApi3_1 to OpenApi3_2
src/OpenApi/src/Services/OpenApiGenerator.cs Adapts to library API change for Content dictionary types
src/OpenApi/src/Services/OpenApiDocumentService.cs Adapts to library API change for Content dictionary types
src/OpenApi/gen/XmlCommentGenerator.Emitter.cs Adds .OfType() filtering when iterating Content values
src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommandWorker.cs Updates default fallback version to OpenApi3_2
src/Tools/GetDocumentInsider/tests/GetDocumentTests.cs Updates test assertions to expect OpenApi3_2
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/CustomSchemaTransformerTests.cs Adapts test setup to use IOpenApiMediaType dictionary type
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Extensions/OpenApiEndpointRouteBuilderExtensionsTests.cs Updates version string assertions from "3.1.1" to "3.1.2"
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/*.cs Updates generated code to use .OfType() pattern
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApi3_1/*.txt Updates version string from "3.1.1" to "3.1.2" in snapshots
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApi3_0/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=schemas-by-ref.verified.txt Updates nullable schema structure from library changes
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApiDocumentLocalizationTests.VerifyOpenApiDocumentIsInvariant.verified.txt Updates version from "3.1.1" to "3.2.0" for default version

/// The version of the OpenAPI specification to use. Defaults to <see cref="OpenApiSpecVersion.OpenApi3_2"/>.
/// </summary>
public OpenApiSpecVersion OpenApiVersion { get; set; } = OpenApiSpecVersion.OpenApi3_1;
public OpenApiSpecVersion OpenApiVersion { get; set; } = OpenApiSpecVersion.OpenApi3_2;
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default OpenAPI version has been changed to OpenApi3_2, but there are no integration tests or snapshot files for this version. The integration tests (in OpenApiDocumentIntegrationTests.cs) only test OpenApi3_0 and OpenApi3_1, and there is no OpenApi3_2 snapshot directory. Before making OpenApi3_2 the default, comprehensive tests and snapshots should be added to ensure the new version works correctly.

Copilot uses AI. Check for mistakes.
var responseString = Encoding.UTF8.GetString(responseBodyStream.ToArray());
// String check to validate that generated document starts with YAML syntax
Assert.Equal(isYaml, responseString.StartsWith("openapi: '3.1.1'", StringComparison.OrdinalIgnoreCase));
Assert.Equal(isYaml, responseString.StartsWith("openapi: '3.1.2'", StringComparison.OrdinalIgnoreCase));
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expected OpenAPI version string has been changed from "3.1.1" to "3.1.2". Please verify that "3.1.2" is a valid OpenAPI specification version. According to the OpenAPI specification, version 3.1.1 exists, but version 3.1.2 may not be an official spec release. This could indicate an issue with the Microsoft.OpenApi library version being used.

Suggested change
Assert.Equal(isYaml, responseString.StartsWith("openapi: '3.1.2'", StringComparison.OrdinalIgnoreCase));
Assert.Equal(isYaml, responseString.StartsWith("openapi: '3.1.1'", StringComparison.OrdinalIgnoreCase));

Copilot uses AI. Check for mistakes.
var responseString = Encoding.UTF8.GetString(responseBodyStream.ToArray());
// String check to validate that generated document starts with YAML syntax
Assert.Equal(isYaml, responseString.StartsWith("openapi: '3.1.1'", StringComparison.OrdinalIgnoreCase));
Assert.Equal(isYaml, responseString.StartsWith("openapi: '3.1.2'", StringComparison.OrdinalIgnoreCase));
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expected OpenAPI version string has been changed from "3.1.1" to "3.1.2". Please verify that "3.1.2" is a valid OpenAPI specification version. According to the OpenAPI specification, version 3.1.1 exists, but version 3.1.2 may not be an official spec release. This could indicate an issue with the Microsoft.OpenApi library version being used.

Suggested change
Assert.Equal(isYaml, responseString.StartsWith("openapi: '3.1.2'", StringComparison.OrdinalIgnoreCase));
Assert.Equal(isYaml, responseString.StartsWith("openapi: '3.1.1'", StringComparison.OrdinalIgnoreCase));

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates that the PR has been added by a community member needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAPI 3.2.0 just released

1 participant