Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Microsoft.OpenApi v2.0.0-preview5 #60002

Merged
merged 4 commits into from
Jan 23, 2025
Merged

Conversation

captainsafia
Copy link
Member

  • Consume changes to add native AoT-compat back to to the library
  • Consume changes to fix OpenAPI tag references in operations
  • React to changes in Serialize APIs

@captainsafia captainsafia requested review from a team and wtgodbe as code owners January 22, 2025 20:04
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jan 22, 2025
src/OpenApi/src/Services/OpenApiDocumentService.cs Outdated Show resolved Hide resolved
@@ -57,7 +57,7 @@ public async Task GenerateAsync(string documentName, TextWriter writer, OpenApiS
using var scopedService = serviceProvider.CreateScope();
var document = await targetDocumentService.GetOpenApiDocumentAsync(scopedService.ServiceProvider);
var jsonWriter = new OpenApiJsonWriter(writer);
document.Serialize(jsonWriter, openApiSpecVersion);
await document.SerializeAsync(jsonWriter, openApiSpecVersion);
Copy link
Member

Choose a reason for hiding this comment

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

Should we be flowing a cancellation token from somewhere? Looks like this might only be for the command line tool so it's fine?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, for this particular codepath, we don't have a CancellationToken to pass through to this API. We could probably consider adding one for the interface overall as part of #58353 but it's not feasible at the moment.

@captainsafia captainsafia requested a review from Copilot January 22, 2025 21:59
Copy link
Contributor

@Copilot 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.

Copilot reviewed 5 out of 14 changed files in this pull request and generated 1 comment.

Files not reviewed (9)
  • eng/Versions.props: Language not supported
  • eng/testing/linker/project.csproj.template: Language not supported
  • src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=controllers.verified.txt: Language not supported
  • src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=forms.verified.txt: Language not supported
  • src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=responses.verified.txt: Language not supported
  • src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=schemas-by-ref.verified.txt: Language not supported
  • src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=v1.verified.txt: Language not supported
  • src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=v2.verified.txt: Language not supported
  • src/Tools/GetDocumentInsider/tests/GetDocumentTests.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)

src/OpenApi/src/Services/OpenApiDocumentService.cs:63

  • [nitpick] Consider using Array.Empty() instead of []. This is more explicit and improves readability.
var schemaTransformers = _options.SchemaTransformers.Count > 0 ? new IOpenApiSchemaTransformer[_options.SchemaTransformers.Count] : [];

src/OpenApi/src/Services/OpenApiGenerator.cs Show resolved Hide resolved
…penApiDocumentService/OpenApiDocumentServiceTests.Operations.cs
…penApiDocumentService/OpenApiDocumentServiceTests.Operations.cs

Co-authored-by: Brennan <[email protected]>
@captainsafia captainsafia merged commit aa38ac3 into main Jan 23, 2025
27 checks passed
@captainsafia captainsafia deleted the openapi-v2-preview5 branch January 23, 2025 02:21
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview1 milestone Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants