-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Upgrade to OpenAPI.NET v2.0.0-preview7 #60269
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this is over my head, but I left a few questions, mostly to help me understand a bit better what this code is doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 8 out of 23 changed files in this pull request and generated no comments.
Files not reviewed (15)
- eng/Versions.props: Language not supported
- src/OpenApi/src/Services/OpenApiGenerator.cs: Evaluated as low risk
- src/OpenApi/src/Extensions/OpenApiDocumentExtensions.cs: Evaluated as low risk
- src/OpenApi/sample/Transformers/AddBearerSecuritySchemeTransformer.cs: Evaluated as low risk
- src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.PolymorphicSchemas.cs: Evaluated as low risk
- src/OpenApi/src/Services/OpenApiDocumentService.cs: Evaluated as low risk
- src/OpenApi/src/Services/OpenApiConstants.cs: Evaluated as low risk
- src/OpenApi/src/Schemas/OpenApiSchemaKeywords.cs: Evaluated as low risk
- src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiDocumentService/OpenApiDocumentServiceTests.Operations.cs: Evaluated as low risk
- src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Extensions/OpenApiRouteHandlerBuilderExtensionTests.cs: Evaluated as low risk
- src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiDocumentService/OpenApiDocumentServiceTests.Responses.cs: Evaluated as low risk
- src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiSchemaService/OpenApiSchemaService.RequestBodySchemas.cs: Evaluated as low risk
- src/OpenApi/src/Schemas/OpenApiJsonSchema.Helpers.cs: Evaluated as low risk
- src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/CreateSchemaReferenceIdTests.cs: Evaluated as low risk
- src/OpenApi/sample/Program.cs: Evaluated as low risk
Comments suppressed due to low confidence (4)
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiDocumentServiceTestsBase.cs:89
- The
OpenApiSchemaService
should be initialized withIOpenApiSchema
instead ofOpenApiSchema
.
var schemaService = new OpenApiSchemaService("Test", Options.Create(new Microsoft.AspNetCore.Http.Json.JsonOptions()), openApiOptions.Object);
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Services/OpenApiDocumentServiceTestsBase.cs:137
- [nitpick] The variable name
jsonOptions
is ambiguous. It should be renamed todefaultJsonOptions
for consistency.
var jsonOptions = builder.ServiceProvider.GetService<IOptions<Microsoft.AspNetCore.Http.Json.JsonOptions>>() ?? Options.Create(defaultJsonOptions);
src/OpenApi/src/Services/Schemas/OpenApiSchemaService.cs:204
- Ensure that the schemaId is present before proceeding. Add a check for schema.Annotations.TryGetValue(OpenApiConstants.SchemaId, out var schemaId) after the ContainsKey check.
if (schema.Annotations.ContainsKey(OpenApiConstants.RefId) &&
src/OpenApi/src/Services/Schemas/OpenApiSchemaService.cs:263
- Ensure that the inputSchema is correctly cast to OpenApiSchema or OpenApiSchemaReference before proceeding. This would prevent any potential runtime errors.
var schema = inputSchema is OpenApiSchemaReference schemaReference
@BrennanConroy @DeagleGross Can I get a review on this? I'd love to merge it in before CC on Friday. |
…a/openapi-preview7
Contributes towards #58619.
nullable
keyword from schema and support null as a value in thetype
propertytype
overrides for primitives types inApplyPrimitiveTypesAndFormats
.Reference
withOpenApiSchemaReference
definitions