Update to Microsoft.OpenApi v2.0.0-preview.11 by captainsafia · Pull Request #60761 · dotnet/aspnetcore (original) (raw)
PR Overview
This PR updates the Microsoft.OpenApi dependency to v2.0.0-preview.11 and removes now‑redundant custom implementations. It also removes workarounds for serialization issues and updates reader registration to align with the new API.
- Updates OpenAPI deserialization by replacing comparer logic with native set handling.
- Removes snapshot test scrubbing for date-based examples due to an upstream bug fix.
- Adapts endpoint routing tests to use new reader settings for YAML support.
Reviewed Changes
File | Description |
---|---|
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Build.Tests/GenerateAdditionalXmlFilesForOpenApiTests.cs | Adds a check for Microsoft.AspNetCore.Identity XML generation. |
src/OpenApi/src/Services/OpenApiDocumentService.cs | Removes redundant tag comparer usage and adjusts tag collection types to use sets. |
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/OpenApiDocumentIntegrationTests.cs | Removes date-time scrubbing now that the upstream serialization issue is fixed. |
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Extensions/OpenApiEndpointRouteBuilderExtensionsTests.cs | Updates reader registration from deprecated methods to OpenApiReaderSettings. |
src/OpenApi/src/Services/OpenApiGenerator.cs | Updates tag collection handling by moving from lists to sets for unique tags. |
src/OpenApi/src/Comparers/OpenApiTagComparer.cs | Removes the now‑redundant custom tag comparer. |
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
src/OpenApi/src/Services/OpenApiDocumentService.cs:349
- [nitpick] For clarity and consistency, consider explicitly using the constructor name ('new OpenApiTagReference(controllerName, document)') rather than relying on type inference in the collection initializer.
return new HashSet<OpenApiTagReference> { new(controllerName, document) };
src/OpenApi/src/Services/OpenApiGenerator.cs:364
- [nitpick] Consider explicitly specifying the type when creating a new OpenApiTagReference for consistency and clarity, e.g. 'new OpenApiTagReference(controllerName, document)'.
return new HashSet<OpenApiTagReference>
{
new(controllerName, document)
};