Revisit: should Overlays declare their target document format? (follow-up to #268)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu với versions/1.2.0-dev.md và quyết định trong #268, sau đó xem xét thay đổi schema của prototype, các fixture đạt/không đạt, các ví dụ đã triển khai và các tập hợp tuân thủ. Chạy bộ test hiện có sau khi phạm vi và các câu hỏi còn bỏ ngỏ được giải quyết; được coi là hoàn tất khi TDC đã thống nhất về định hướng biên tập và quy chuẩn, đồng thời các thay đổi đối với đặc tả đã được chấp nhận.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Revisit: should Overlays declare their target document format? (follow-up to #268)
Why I am reopening this
#268 asked whether Overlays are intended for Arazzo, and was closed as NOT_PLANNED on 2026-02-10 with this reasoning:
Although this might technically be possible today this is not a "core function" of this specification, which is intended for OpenAPI descriptions. [...] The intent in the future might be to have selection mechanisms that are "type based" (visitor pattern), and opening overlays to other document types would generally go against such an improvement.
I am not asking the TDC to reverse that on the same evidence. #268 was a one-line question with no supporting argument, and the answer was reasonable given what was in front of it. I would like to put two things on the table that were not raised at the time — one about Arazzo, one about a failure mode — and to respond directly to the visitor-pattern objection, which I think is the strongest point in that thread and also the one most likely to be backwards.
1. Arazzo is already multi-format, and OAI already published the exact value set
This is the argument I most want a view on.
The released Arazzo 1.1.0 specification defines the Source Description Object's type field as:
The type of source description. Possible values are
"openapi"or"asyncapi"or"arazzo".
That is not incidental. Arazzo has normative AsyncAPI-specific behavior — correlationId is documented as "Only applicable to asyncapi steps with action receive" — and its reference-resolution rules explicitly describe resolving "an OpenAPI or AsyncAPI description via a Source Description url field".
So within the OAI family, the position that a description-manipulating specification should be OpenAPI-only is already not the house style. Arazzo, the newer specification, is explicitly multi-format, and it settled on precisely the three-value set {openapi, asyncapi, arazzo}.
Two consequences:
- The cross-org concern is already spent. Naming AsyncAPI normatively in an OAI specification is not a new commitment for the Initiative to weigh — Arazzo made it, in a released version.
- Overlay would not be inventing a registry. It can adopt Arazzo's value set verbatim. Two OAI specifications describing the same three formats with the same three tokens seems strictly better than one of them declining to name them at all.
It seems odd for Overlay to be the specification that cannot be applied to an Arazzo document, when Arazzo itself is comfortable pointing at all three formats.
2. Wrong-format application fails silently, and the format has no way to catch it
Applying an Overlay to the wrong kind of document produces no error today. Since a target that selects zero nodes is defined to succeed without changing the document:
# written against an AsyncAPI document
overlay: 1.2.0
info:
title: Mark all channels as internal
version: 1.0.0
actions:
- target: $.channels.*
update:
x-internal: true
Run that against an OpenAPI Description and every action selects nothing, every action succeeds, the tool exits 0, and the user believes their document was transformed. Nothing in the Overlay format lets a tool distinguish "this Overlay did not apply here" from "this Overlay had nothing to do".
This is worth addressing whatever the TDC decides about scope. Even a strictly OpenAPI-only Overlay ecosystem has this problem the moment anyone writes an Overlay against a document that is not an OpenAPI Description — which, per #268's own "might technically be possible today", they already can and do.
3. On the visitor-pattern objection
The concern in #268 was that type-based selection is a likely future direction, and opening Overlay to other document types would work against it.
I would argue the opposite: a type-based selector has to know which type model to apply before it can resolve, say, a selector for Operation Objects. In an OpenAPI-only world that knowledge is implicit — and being implicit, it is also unstated and unvalidated. A visitor is easier to build over an Overlay that declares the type model it was written against than over one where the tool has to sniff the target document first and hope.
Put differently: type-based selection needs a type model per format. Declaring the format is a prerequisite for that work, not an obstacle to it. If Overlay later grows type-aware selectors and stays OpenAPI-only, the declared format is simply always openapi and nothing is lost.
What I am actually proposing
Deliberately smaller than "Overlays for any JSON document" — that framing was rejected in #268 and I am not re-raising it.
A. Editorial. Define a target document term and state which formats the specification recognizes, rather than leaving the OpenAPI coupling implicit in the Abstract, the Introduction, the Format section, and a heading called Comments in OpenAPI Descriptions.
B. Normative. One optional field on the Overlay Object:
overlay: 1.2.0
info:
title: Mark all channels as internal
version: 1.0.0
targetFormat: asyncapi
actions:
- target: $.channels.*
update:
x-internal: true
- Optional — omitted means no assertion, so every existing Overlay is unaffected and every existing tool stays conformant.
- Values
openapi/asyncapi/arazzo, matching Arazzo's Source Descriptiontypeexactly; other values SHOULD be absolute URIs so private formats cannot collide with future reserved ones. - Independent of
extends—extendsnames a document,targetFormatnames a format. - On mismatch, where tooling can determine the target's format (usually from the root
openapi/asyncapi/arazzofield), it SHOULD report an error and SHOULD NOT apply. - A format, not a version — the version comes from the target document.
- Unrecognized values MAY still be applied with a warning, so format-blind tools remain conformant.
Note that B is useful even if the TDC holds the line on scope. If Overlay stays OpenAPI-only, targetFormat: openapi is still the mechanism that turns "silently did nothing" into "this Overlay is not for this document".
Open questions
- Field name.
targetFormatmatches OAI camelCase and the "target document" terminology, but sits next to the Action Object's unrelatedtarget(a JSONPath).extendsFormatis an alternative. Arazzo just calls ittype. - Single value or list? One string means an Overlay genuinely valid for several formats must omit the field.
SHOULD NOTorMUST NOTapply on mismatch? SHOULD leaves room for a--forceescape hatch.- Scope split. Is A acceptable without B, or B without A?
- Does this actually conflict with the visitor-pattern plan, in the view of whoever is furthest along thinking about it? I would rather find out now than after a PR.
Prototype
I have a working branch against versions/1.2.0-dev.md implementing both parts — spec text, the schema change, pass/fail fixtures, worked AsyncAPI and Arazzo examples, and matching compliant sets. The existing suite passes with JSON Schema keyword coverage still at 100%. I am deliberately not opening it as a PR until there is a view on direction, given #268.
Happy to bring this to a Tuesday Overlays call if that is the better venue.
- Ngôn ngữ chính
- JavaScript
- Star
- 122
- Fork
- 38
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OAI/Overlay-Specification
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
OAI/Overlay-Specification#415 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ci: update the agenda template to lead us down the path of checking the spec repoCó thể đã có người làm @baywet đã nhận 10 ngày trước. Đang mở
OAI/Overlay-Specification#411 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ci: add automation to sync from main -> dev -> vX.Y-dev branchesCó thể đã có người làm @baywet đã nhận 10 ngày trước. Đang mở
OAI/Overlay-Specification#410 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
OAI/Overlay-Specification#358 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
OAI/Overlay-Specification#299 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của OAI/Overlay-Specification
Issue tương tự
-
BUG
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
type/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
flarum/framework#5231 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/rocketmq-dashboard#6896 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[workshop-sync] workshop/side-quest-17-06-output-injection.md: stale add_comment.cjs line referencesĐang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
githubnext/gh-aw-workshop#4679 ·
Maintainer thường phản hồi trong vòng 1 ngày