feat/external anchors and relative ids#2918
Conversation
Code Coverage OverviewLanguages: C# C# / code-coverage/dotnetThe overall coverage in the branch remains at 88%, unchanged from the branch. Show a code coverage summary of the most impacted files.
Updated |
|
@copilot update the performance reports |
Done — benchmark reports updated in commit chore(benchmark): update performance reports. |
feat: adds support for relative ids Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
c62d21f to
6e9f76b
Compare
There was a problem hiding this comment.
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
$anchorfragment resolution and nested$id-based subschema resolution (v3.1 + v3.2). - Register
$anchorand$ididentifiers for component schemas and their nested subschemas inOpenApiWorkspace. - 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. |
|
Youssef1313
left a comment
There was a problem hiding this comment.
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)



related MicrosoftDocs/openapi-docs#167 and #2913