Skip to content

[release/10.0] Update OpenApi to 2.12 - #68468

Open
Youssef1313 wants to merge 4 commits into
release/10.0from
dev/ygerges/openapi-2.12
Open

[release/10.0] Update OpenApi to 2.12#68468
Youssef1313 wants to merge 4 commits into
release/10.0from
dev/ygerges/openapi-2.12

Conversation

@Youssef1313

Copy link
Copy Markdown
Member

No description provided.

@Youssef1313
Youssef1313 marked this pull request as ready for review August 13, 2026 04:40
@Youssef1313
Youssef1313 requested a review from wtgodbe as a code owner August 13, 2026 04:40
Copilot AI lite review requested due to automatic review settings August 13, 2026 04:40
@Youssef1313
Youssef1313 requested a review from a team as a code owner August 13, 2026 04:40

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

Updates the repository’s dependency version constraints for the Microsoft.OpenApi and Microsoft.OpenApi.YamlReader packages to allow resolving OpenApi 2.12.x (while still preventing 3.x).

Changes:

  • Bumped MicrosoftOpenApiVersion minimum from 2.7.5 to 2.12.0 (range remains < 3.0.0).
  • Bumped MicrosoftOpenApiYamlReaderVersion minimum from 2.7.5 to 2.12.0 (range remains < 3.0.0).

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@Youssef1313 Youssef1313 changed the title Update OpenApi to 2.12 [release/10.0] Update OpenApi to 2.12 Aug 13, 2026
@Youssef1313

Copy link
Copy Markdown
Member Author

@copilot OpenApiSchema.Example is now deprecated. Update the usage to OpenApiSchema.Examples.

Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Copilot AI requested a review from a team as a code owner August 13, 2026 09:31

Copilot AI commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@copilot OpenApiSchema.Example is now deprecated. Update the usage to OpenApiSchema.Examples.

Done in a02b7c9 — the XML comment schema transformer now sets schema.Examples = [example] instead of the deprecated schema.Example. Generator snapshots and tests were updated, along with the OpenAPI 3.1 integration snapshots (3.1 now serializes examples: [...]; 3.0 output is unchanged since a single-item Examples still writes example).

Note: OpenApiDocumentIntegrationTests.VerifyOpenApiDocument(documentName: "schemas-by-ref", version: OpenApi3_0) fails on this branch independently of this change — with 2.12, nullable schema references now serialize as oneOf: [{ "enum": [null], "nullable": true }, { "$ref": ... }] instead of the previous type: object + nullable: true shape. I left that snapshot alone since it's a library behavior change worth a deliberate decision.

{
schema.Description = typeComment.Summary;
if (typeComment.Examples?.FirstOrDefault() is { } jsonString)
if (typeComment.Examples?.FirstOrDefault().Parse() is { } example)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@copilot Don't move the Parse call around. Keep the original structure.

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.

Reverted in 3b7cb1e — back to if (typeComment.Examples?.FirstOrDefault() is { } jsonString) with schema.Examples = [jsonString.Parse()!];, matching the existing x-ref-example pattern below. Snapshots regenerated.

Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
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