DRAFT: target document format declaration (targetFormat) — for discussion on #367 - #370
Draft
bielu wants to merge 1 commit into
Draft
DRAFT: target document format declaration (targetFormat) — for discussion on #367#370bielu wants to merge 1 commit into
bielu wants to merge 1 commit into
Conversation
Overlay is already format agnostic in substance: Actions are RFC 9535 JSONPath queries over a JSON/YAML tree, the merge rules are defined only in terms of objects, arrays and primitives, and the JSON Schema places no constraint on the target. Only the prose ties it to OpenAPI. Generalize the prose in 1.2.0-dev to a defined "target document" term recognizing OpenAPI Descriptions, AsyncAPI documents and Arazzo Descriptions, and add an optional targetFormat field so an Overlay can declare the format it was written for. targetFormat is optional, so existing Overlays are unaffected and tools that ignore it stay conformant. Its values match Arazzo's Source Description "type" field exactly (openapi, asyncapi, arazzo); other values SHOULD be absolute URIs. Without it, applying an Overlay to the wrong kind of document fails silently, because a target selecting zero nodes is defined to succeed. Not an enum in the JSON Schema: the specification permits URI values for formats it does not define, so an enum would reject conformant documents. AsyncAPI and Arazzo are not in specref, so they are added to the localBiblio block that already carried a comment saying to do this. Refs OAI#367 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
A draft PR opened at @lornajane's request on #367, to make the proposed changes concrete enough to discuss. It is not a request to merge.
To be explicit about where this stands: the response on #367 was that the group is "still pretty well aligned with the remarks in #268", and nothing here should be read as assuming otherwise. This exists so the discussion can be about specific text rather than a description of specific text. If the outcome is that Overlay stays OpenAPI-scoped, closing this is a perfectly good result — though I would flag that part of it (below) has value either way.
Refs #367, #268.
How to review this in pieces
The change splits cleanly in two, and the group may want one, the other, neither, or a smaller version of either. They are in one branch only for convenience and I am happy to separate them.
Part A — editorial: generalize prose to "target document"
versions/1.2.0-dev.mdcurrently ties Overlay to OpenAPI in the Abstract, the Introduction, theFormatsection'sImplementations MUST support applying ... to OpenAPI descriptions, and a heading called Comments in OpenAPI Descriptions. Part A introduces a defined target document term and names the three recognized formats, while explicitly permitting implementations to support only a subset — so an OpenAPI-only tool stays conformant.This part is the one that depends on the scope question. If the group holds the #268 line, Part A largely goes away.
Two normative mentions of OpenAPI are left in place on purpose: the subset-support allowance, and the
x-oai-/x-oas-extension reservation.Part B — normative: optional
targetFormaton the Overlay Objectopenapi/asyncapi/arazzo, matching Arazzo 1.1.0's Source Descriptiontypefield exactly; other values SHOULD be absolute URIs so private formats cannot collide with future reserved values.extends—extendsnames a document,targetFormatnames a format.Part B stands on its own even if the scope question goes the other way. Its real job is the silent-failure case from #367: because a
targetselecting zero nodes is defined to succeed, applying an Overlay to the wrong document exits 0 having changed nothing. In an OpenAPI-only Overlay ecosystem that is still reachable, andtargetFormat: openapiis still the thing that turns it into an error. If the group wants only Part B, scoped to a single legal value today, that is a coherent change and I would be glad to cut it down to that.Implementation notes worth a second opinion
targetFormatistype: string, minLength: 1in the JSON Schema, deliberately not anenum. Since the spec text permits URI values for formats it does not define, an enum would make conformant documents fail schema validation. If the group would rather constrain it, that spec text needs to change too.updateon an array node appends. The Arazzo example leans on this (appending a success criterion to every step'ssuccessCriteria). It follows the existing Action Object rules, but it is the least obvious behavior exercised here, so worth a look.[[AsyncAPI]]and[[Arazzo]]are not in specref ([[OpenAPI]]is), so they are added to thelocalBiblioblock inscripts/md2html/md2html.js— which already carried a comment saying to do exactly this and to remove entries once published to specref. If these should be pushed to specref first, say so and I will drop the local entries.overlay: '1.2.0'while the existing sets use1.0.0, because they demonstrate a 1.2.0 feature. Flagging in case mixing versions in that directory is unwanted.Verification
npm test— 109 pass. JSON Schema keyword (statement) coverage stays 100%; v1.2-dev function coverage 91.9% → 95.5%.npx markdownlint-cli2 "*.md" "schemas/**/*.md" "versions/*.md"— 0 issues.node scripts/md2html/md2html.js --maintainers EDITORS.md versions/1.2.0-dev.mdrenders clean with the newlocalBiblio.schemas/v1.2-dev/schema.yaml. (scripts/validate.mjsis hardcoded toschemas/v1.0/, so this needed a one-off script — possibly worth a separate issue.)linkspectorcould not run locally (headless-browser timeout); the two new external URLs were confirmed HTTP 200 by hand. CI will be the real check.Open questions
Carried over from #367, still open:
targetFormatmatches OAI camelCase and the "target document" terminology, but sits next to the Action Object's unrelatedtarget(a JSONPath). Arazzo just calls ittype.SHOULD NOTorMUST NOTapply on mismatch? SHOULD leaves room for a--forceescape hatch.Per CONTRIBUTING.md, changes under
versions/need approval from two Overlay-Maintainers. Leaving this as a draft until there is a direction.