Skip to content

feat/external anchors and relative ids#2918

Open
baywet wants to merge 5 commits into
mainfrom
feat/external-anchors-and-relative-ids
Open

feat/external anchors and relative ids#2918
baywet wants to merge 5 commits into
mainfrom
feat/external-anchors-and-relative-ids

Conversation

@baywet

@baywet baywet commented Jun 29, 2026

Copy link
Copy Markdown
Member

@baywet baywet self-assigned this Jun 29, 2026
@github-code-quality

github-code-quality Bot commented Jun 29, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall coverage in the branch remains at 88%, unchanged from the branch.

Show a code coverage summary of the most impacted files.
File beb68f5 f7d87f0 +/-
/home/runner/wo...nApiDocument.cs 89% 89% 0%
/home/runner/wo...ApiWorkspace.cs 89% 92% +3%

Updated July 03, 2026 14:45 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@baywet

baywet commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

@copilot update the performance reports

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@copilot update the performance reports

Done — benchmark reports updated in commit chore(benchmark): update performance reports.

baywet and others added 4 commits July 3, 2026 10:32
feat: adds support for relative ids

Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
@baywet baywet force-pushed the feat/external-anchors-and-relative-ids branch from c62d21f to 6e9f76b Compare July 3, 2026 14:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extends reference resolution for JSON Schema usage in OpenAPI 3.1/3.2 by supporting external plain-name fragment anchors (#anchor) and by registering $id-based schema identifiers for nested subschemas so they can be targeted by absolute/relative IDs.

Changes:

  • Add reader tests for external $anchor fragment resolution and nested $id-based subschema resolution (v3.1 + v3.2).
  • Register $anchor and $id identifiers for component schemas and their nested subschemas in OpenApiWorkspace.
  • Adjust schema reference URI construction to preserve external plain-name fragments (e.g., OAS-schemas.yaml#address) rather than forcing JSON Pointer fragments.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/Microsoft.OpenApi.Readers.Tests/V32Tests/RelativeReferenceTests.cs Adds v3.2 regression tests for external $anchor refs and nested $id refs.
test/Microsoft.OpenApi.Readers.Tests/V31Tests/RelativeReferenceTests.cs Adds v3.1 regression tests for external $anchor refs and nested $id refs.
src/Microsoft.OpenApi/Services/OpenApiWorkspace.cs Registers $anchor/$id schema identifiers for nested subschemas and resolves non-JSON-pointer fragments via the workspace registry.
src/Microsoft.OpenApi/Models/OpenApiDocument.cs Preserves external plain-name fragments when constructing schema reference URIs for workspace lookup.
performance/benchmark/BenchmarkDotNet.Artifacts/results/performance.EmptyModels-report.html Updated benchmark artifact output.
performance/benchmark/BenchmarkDotNet.Artifacts/results/performance.EmptyModels-report.csv Updated benchmark artifact output.
performance/benchmark/BenchmarkDotNet.Artifacts/results/performance.EmptyModels-report-github.md Updated benchmark artifact output.
performance/benchmark/BenchmarkDotNet.Artifacts/results/performance.Descriptions-report.json Updated benchmark artifact output.
performance/benchmark/BenchmarkDotNet.Artifacts/results/performance.Descriptions-report.html Updated benchmark artifact output.
performance/benchmark/BenchmarkDotNet.Artifacts/results/performance.Descriptions-report.csv Updated benchmark artifact output.
performance/benchmark/BenchmarkDotNet.Artifacts/results/performance.Descriptions-report-github.md Updated benchmark artifact output.

Comment thread src/Microsoft.OpenApi/Services/OpenApiWorkspace.cs Outdated
Comment thread src/Microsoft.OpenApi/Models/OpenApiDocument.cs
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated no new comments.

@Youssef1313 Youssef1313 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not familiar on everything but giving a sign-off (thought the approval won't be counting anyways as I'm not a maintainer in this repo)

@baywet baywet marked this pull request as ready for review July 3, 2026 15:40
@baywet baywet requested a review from a team as a code owner July 3, 2026 15:40
@baywet baywet enabled auto-merge (squash) July 3, 2026 15:40
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.

4 participants