Skip to content

OpenAPI: Add snapshot test for nullable reference type arrays - #68591

Merged
Youssef1313 merged 1 commit into
mainfrom
dev/ygerges/add-test
Aug 18, 2026
Merged

Youssef1313 merged 1 commit into
mainfrom
dev/ygerges/add-test

Conversation

@Youssef1313

@Youssef1313 Youssef1313 commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

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

Copilot AI lite review requested due to automatic review settings August 17, 2026 16:18
@Youssef1313
Youssef1313 requested review from a team, cincuranet and rokonec as code owners August 17, 2026 16:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 items nullability 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.

@Youssef1313
Youssef1313 merged commit 50ab8b5 into main Aug 18, 2026
28 checks passed
@Youssef1313
Youssef1313 deleted the dev/ygerges/add-test branch August 18, 2026 16:32
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants