OpenAPI: Add snapshot test for nullable reference type arrays - #68591
Open
Youssef1313 wants to merge 1 commit into
Open
OpenAPI: Add snapshot test for nullable reference type arrays#68591Youssef1313 wants to merge 1 commit into
Youssef1313 wants to merge 1 commit into
Conversation
Youssef1313
requested review from
a team,
cincuranet and
rokonec
as code owners
August 17, 2026 16:18
Contributor
There was a problem hiding this comment.
Pull request overview
Adds coverage to the OpenAPI integration snapshot tests to ensure nullable reference-type array element nullability (e.g., string?[]) is represented correctly in generated parameter schemas, as a follow-up to #68250.
Changes:
- Adds a new sample endpoint exercising nullable vs non-nullable reference array elements in query parameters.
- Updates OpenAPI integration snapshots (3.0/3.1/3.2) to include the new path and expected
itemsnullability representation. - Updates the localization invariance snapshot to include the same new path and schema output.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/OpenApi/sample/Endpoints/MapSchemasEndpoints.cs | Adds a new endpoint for string?[] vs string[] query parameters to drive snapshot coverage. |
| src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApiDocumentLocalizationTests.VerifyOpenApiDocumentIsInvariant.verified.txt | Updates invariant snapshot with the new endpoint’s expected schema. |
| src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApi3_2/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=schemas-by-ref.verified.txt | Updates OpenAPI 3.2 snapshot with the new endpoint’s expected schema. |
| src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApi3_1/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=schemas-by-ref.verified.txt | Updates OpenAPI 3.1 snapshot with the new endpoint’s expected schema. |
| src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApi3_0/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=schemas-by-ref.verified.txt | Updates OpenAPI 3.0 snapshot with the new endpoint’s expected schema using nullable: true on items. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #68250
I realized late that the added integration tests in #68250 mostly covered nullable value types and not nullable reference types. The only test that covered nullable reference types was a unit test in
OpenApiSchemaService/OpenApiSchemaService.ParameterSchemas.cs