Skip to content

Support OpenAPI 3.0 schema objects - #1309

Merged
jviotti merged 5 commits into
mainfrom
openapi-3-0-ingestion
Oct 28, 2026
Merged

jviotti merged 5 commits into
mainfrom
openapi-3-0-ingestion

Conversation

@jviotti

@jviotti jviotti commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

View guided diff

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@augmentcode

augmentcode Bot commented Oct 28, 2026

Copy link
Copy Markdown

This pull request is abnormally large and would use a significant amount of tokens to review. If you still wish to review it, comment "augment review" and we will review it.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti

jviotti commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

augment review

@augmentcode

augmentcode Bot commented Oct 28, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR adds support for OpenAPI 3.0 Schema Objects. These schemas cannot declare their dialect with $schema or carry an identifier, so a collection's defaultDialect supplies the dialect instead.

Changes:

  • Resolver now removes $schema from the document and adds $schema/$id back only when the dialect's vocabularies define those keywords (dialect_defines). The dialect is now read from the resolver entry instead of the document.
  • Adds Resolver::dialect_of. Index generators (materialise, bundle, editor, locations, dependencies, health, blaze templates, stats, explorer metadata/dependents) now pass the entry's dialect and identifier to SchemaFrame, schema_bundle, for_editor, lint, and similar functions.
  • Adds RouterAction::artifact_dialect, which reads the dialect from the metapack extension. Enterprise conversion checks now use it through served_schema_dialect (ladder rung plus a "custom" flag) instead of reading $schema from the document.
  • Adds the OAS 3.0 base vocabulary to the stats response schema, and updates docs to mention OpenAPI 3.0 and how to configure it.
  • Adds new openapi3.0 fixtures, e2e hurl suites, and CLI snapshot tests for both the 2021-09-28 and 2024-10-18 dialect URIs. Updates the large set of existing hurl expectations for the new collection (counts, ordering, pagination cursors).

Technical Notes: Because OAS 3.0 artifacts no longer contain $schema or $id, anything that consumes them must get the dialect from outside the document, either from the resolver entry or the metapack extension.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot 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.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/resolver/resolver.cc
const auto &root_location{frame.root_location().value().get()};
const auto &root_vocabularies{frame.vocabularies(root_location, subresolver)};

if (dialect_defines(root_vocabularies, "$schema")) {

@augmentcode augmentcode Bot Oct 28, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since an OAS 3.0 schema is now returned with no $schema, it can only be read correctly by callers that pass its dialect in from outside. A schema in a different dialect that $refs it (e.g. modern.json (2020-12) referencing identifier, a playground schema, or a conversion closure) will frame, compile and bundle the target under the referrer's dialect, so nullable/boolean exclusiveMinimum get the wrong meaning or fail metaschema checks. Consider how cross-dialect references to these schemas should keep their dialect, for example when bundling or when the subresolver is called, or explicitly reject them.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@github-actions github-actions Bot 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.

Benchmark (community)

Details
Benchmark suite Current: a87f797 Previous: 12328ab Ratio
Add one schema (0 existing) 149 ms 254 ms 0.59
Add one schema (100 existing) 32 ms 37 ms 0.86
Add one schema (1000 existing) 72 ms 75 ms 0.96
Add one schema (10000 existing) 661 ms 535 ms 1.24
Update one schema (1 existing) 22 ms 32 ms 0.69
Update one schema (101 existing) 32 ms 37 ms 0.86
Update one schema (1001 existing) 81 ms 80 ms 1.01
Update one schema (10001 existing) 646 ms 543 ms 1.19
Cached rebuild (1 existing) 9 ms 9 ms 1
Cached rebuild (101 existing) 12 ms 10 ms 1.20
Cached rebuild (1001 existing) 35 ms 35 ms 1
Cached rebuild (10001 existing) 232 ms 184 ms 1.26
Index 100 schemas 345 ms 316 ms 1.09
Index 1000 schemas 819 ms 1067 ms 0.77
Index 10000 schemas 9068 ms 10081 ms 0.90
Index 10000 schemas (custom meta-schema) 10768 ms 13424 ms 0.80
Index 10000 schemas ($ref fan-out) 10240 ms 12314 ms 0.83
test/e2e/html: Schema Fetch (p50) 203 us 295 us 0.69
test/e2e/html: Schema Fetch (p99) 243 us 365 us 0.67

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot 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.

Benchmark (enterprise)

Details
Benchmark suite Current: a87f797 Previous: 12328ab Ratio
Add one schema (0 existing) 540 ms 604 ms 0.89
Add one schema (100 existing) 125 ms 123 ms 1.02
Add one schema (1000 existing) 178 ms 171 ms 1.04
Add one schema (10000 existing) 793 ms 779 ms 1.02
Update one schema (1 existing) 108 ms 110 ms 0.98
Update one schema (101 existing) 121 ms 122 ms 0.99
Update one schema (1001 existing) 183 ms 179 ms 1.02
Update one schema (10001 existing) 843 ms 821 ms 1.03
Cached rebuild (1 existing) 13 ms 14 ms 0.93
Cached rebuild (101 existing) 17 ms 17 ms 1
Cached rebuild (1001 existing) 52 ms 43 ms 1.21
Cached rebuild (10001 existing) 318 ms 302 ms 1.05
Index 100 schemas 757 ms 718 ms 1.05
Index 1000 schemas 1842 ms 1876 ms 0.98
Index 10000 schemas 16273 ms 16208 ms 1.00
Index 10000 schemas (custom meta-schema) 16309 ms 16106 ms 1.01
Index 10000 schemas ($ref fan-out) 20918 ms 20989 ms 1.00
enterprise/e2e/auth: Schema Anonymous (p50) 391 us 398 us 0.98
enterprise/e2e/auth: Schema Anonymous (p99) 507 us 506 us 1.00
enterprise/e2e/auth: Schema API Key Identity (p50) 395 us 402 us 0.98
enterprise/e2e/auth: Schema API Key Identity (p99) 510 us 514 us 0.99
enterprise/e2e/auth: Schema API Key SHA256 (p50) 400 us 408 us 0.98
enterprise/e2e/auth: Schema API Key SHA256 (p99) 525 us 521 us 1.01
enterprise/e2e/auth: Schema JWT (p50) 524 us 533 us 0.98
enterprise/e2e/auth: Schema JWT (p99) 675 us 684 us 0.99
test/e2e/html: Schema Fetch (p50) 395 us 403 us 0.98
test/e2e/html: Schema Fetch (p99) 490 us 505 us 0.97

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti
jviotti merged commit 18b9cca into main Oct 28, 2026
6 checks passed
@jviotti
jviotti deleted the openapi-3-0-ingestion branch October 28, 2026 17:36
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.

1 participant