@speclynx/apidom-reference 5.2.2 → 5.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +30 -11
- package/dist/apidom-reference.browser.js +1121 -516
- package/dist/apidom-reference.browser.min.js +1 -1
- package/package.json +28 -28
- package/src/bundle/strategies/arazzo-1/visitor.cjs +105 -22
- package/src/bundle/strategies/arazzo-1/visitor.mjs +107 -24
- package/src/bundle/strategies/openapi-3-1/visitor.cjs +197 -47
- package/src/bundle/strategies/openapi-3-1/visitor.mjs +200 -50
- package/src/bundle/util.cjs +57 -2
- package/src/bundle/util.mjs +52 -0
- package/src/dereference/strategies/arazzo-1/index.cjs +9 -7
- package/src/dereference/strategies/arazzo-1/index.mjs +3 -1
- package/src/dereference/strategies/arazzo-1/selectors/$anchor.cjs +6 -0
- package/src/dereference/strategies/arazzo-1/selectors/$anchor.mjs +1 -1
- package/src/dereference/strategies/arazzo-1/selectors/uri.cjs +6 -0
- package/src/dereference/strategies/arazzo-1/selectors/uri.mjs +1 -1
- package/src/dereference/strategies/arazzo-1/util.cjs +6 -0
- package/src/dereference/strategies/arazzo-1/util.mjs +1 -1
- package/src/dereference/strategies/arazzo-1/visitor.cjs +67 -9
- package/src/dereference/strategies/arazzo-1/visitor.mjs +71 -13
- package/src/dereference/strategies/openapi-3-1/index.cjs +2 -1
- package/src/dereference/strategies/openapi-3-1/index.mjs +3 -1
- package/src/dereference/strategies/openapi-3-1/selectors/$anchor.cjs +16 -4
- package/src/dereference/strategies/openapi-3-1/selectors/$anchor.mjs +14 -3
- package/src/dereference/strategies/openapi-3-1/selectors/json-pointer.cjs +29 -0
- package/src/dereference/strategies/openapi-3-1/selectors/json-pointer.mjs +22 -0
- package/src/dereference/strategies/openapi-3-1/selectors/uri.cjs +54 -27
- package/src/dereference/strategies/openapi-3-1/selectors/uri.mjs +51 -27
- package/src/dereference/strategies/openapi-3-1/util.cjs +75 -14
- package/src/dereference/strategies/openapi-3-1/util.mjs +68 -14
- package/src/dereference/strategies/openapi-3-1/visitor.cjs +85 -9
- package/src/dereference/strategies/openapi-3-1/visitor.mjs +89 -13
- package/src/util/url.cjs +35 -2
- package/src/util/url.mjs +32 -0
- package/types/apidom-reference.d.ts +12 -0
- package/types/bundle/strategies/arazzo-1/index.d.ts +1 -1
- package/types/bundle/strategies/arazzo-1/visitor.d.ts +51 -6
- package/types/bundle/strategies/openapi-3-1/index.d.ts +1 -1
- package/types/bundle/strategies/openapi-3-1/visitor.d.ts +59 -3
- package/types/bundle/util.d.ts +39 -0
- package/types/dereference/strategies/arazzo-1/selectors/$anchor.d.ts +1 -1
- package/types/dereference/strategies/arazzo-1/selectors/uri.d.ts +1 -1
- package/types/dereference/strategies/arazzo-1/util.d.ts +1 -1
- package/types/dereference/strategies/arazzo-1/visitor.d.ts +17 -1
- package/types/dereference/strategies/openapi-3-1/selectors/$anchor.d.ts +8 -0
- package/types/dereference/strategies/openapi-3-1/selectors/json-pointer.d.ts +9 -0
- package/types/dereference/strategies/openapi-3-1/selectors/uri.d.ts +37 -4
- package/types/dereference/strategies/openapi-3-1/util.d.ts +53 -2
- package/types/dereference/strategies/openapi-3-1/visitor.d.ts +17 -1
- package/types/util/url.d.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.2.5](https://github.com/speclynx/apidom/compare/v5.2.4...v5.2.5) (2026-09-17)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **reference:** assign relative $id to embedded schema resources ([#543](https://github.com/speclynx/apidom/issues/543)) ([3ba02e8](https://github.com/speclynx/apidom/commit/3ba02e82ea22a93b40d04c43ec190810a0f4b177)), closes [#531](https://github.com/speclynx/apidom/issues/531)
|
|
11
|
+
- **reference:** defer bundle placement until entry traversal ends ([#538](https://github.com/speclynx/apidom/issues/538)) ([e70f735](https://github.com/speclynx/apidom/commit/e70f73503f21074dda67928d223842df1bdf43f9)), closes [#535](https://github.com/speclynx/apidom/issues/535)
|
|
12
|
+
- **reference:** embed sibling $id schemas of hoisted OAS 3.1 content ([#547](https://github.com/speclynx/apidom/issues/547)) ([65d0998](https://github.com/speclynx/apidom/commit/65d09986191ea5dfb12ee63b78a56bba8ca18057)), closes [#546](https://github.com/speclynx/apidom/issues/546)
|
|
13
|
+
- **reference:** rebase schema $ref onto embedded resource $id ([#532](https://github.com/speclynx/apidom/issues/532)) ([840c89c](https://github.com/speclynx/apidom/commit/840c89cdddab270ac6cdc389fc27c8be24e4a857)), closes [#530](https://github.com/speclynx/apidom/issues/530) [#531](https://github.com/speclynx/apidom/issues/531) [usearazzo/arazzo-toolkit#158](https://github.com/usearazzo/arazzo-toolkit/issues/158)
|
|
14
|
+
- **reference:** relocate schema $refs in hoisted OAS 3.1 components ([#542](https://github.com/speclynx/apidom/issues/542)) ([71e067b](https://github.com/speclynx/apidom/commit/71e067b019f809f37a08cb185d61a75d9d07715b)), closes [#537](https://github.com/speclynx/apidom/issues/537)
|
|
15
|
+
- **reference:** resolve schema $id lookups against document base URI ([#539](https://github.com/speclynx/apidom/issues/539)) ([e4763fa](https://github.com/speclynx/apidom/commit/e4763fada3b569c5811b1a8f02014017ef1d2679)), closes [#536](https://github.com/speclynx/apidom/issues/536)
|
|
16
|
+
- **reference:** resolve schema $id within referenced OAS 3.1 fragments ([#545](https://github.com/speclynx/apidom/issues/545)) ([c69ab53](https://github.com/speclynx/apidom/commit/c69ab531bde79a10bdd7406d9c8f56ea7536436b)), closes [#541](https://github.com/speclynx/apidom/issues/541)
|
|
17
|
+
|
|
18
|
+
## [5.2.4](https://github.com/speclynx/apidom/compare/v5.2.3...v5.2.4) (2026-09-15)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @speclynx/apidom-reference
|
|
21
|
+
|
|
22
|
+
## [5.2.3](https://github.com/speclynx/apidom/compare/v5.2.2...v5.2.3) (2026-09-15)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @speclynx/apidom-reference
|
|
25
|
+
|
|
6
26
|
## [5.2.2](https://github.com/speclynx/apidom/compare/v5.2.1...v5.2.2) (2026-09-03)
|
|
7
27
|
|
|
8
28
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -2909,12 +2909,26 @@ inlined in place. Example Object `externalValue` content is inlined, and an exte
|
|
|
2909
2909
|
|
|
2910
2910
|
**Schema Objects** are a [JSON Schema 2020-12](https://json-schema.org/draft/2020-12) dialect and are
|
|
2911
2911
|
bundled per the [JSON Schema Compound Document](https://json-schema.org/blog/posts/bundling-json-schema-compound-documents)
|
|
2912
|
-
rules: the external schema **resource** is embedded verbatim into `components.schemas` carrying its `$id
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2912
|
+
rules: the external schema **resource** is embedded verbatim into `components.schemas` carrying its `$id`.
|
|
2913
|
+
A resource without a `$id` of its own gets one assigned as a URI-reference relative to the entry document's
|
|
2914
|
+
base URI (e.g. `schemas/ex.json`), so the bundle carries no absolute filesystem paths and stays self-contained
|
|
2915
|
+
when moved as a directory tree. The referencing `$ref` is **rebased** onto the embedded
|
|
2916
|
+
resource's `$id` (keeping any `$anchor` or JSON Pointer fragment) whenever it resolves to a different URI —
|
|
2917
|
+
e.g. `./ex.json#/$defs/Pet` becomes `https://example.com/schemas/pets#/$defs/Pet` — since once embedded the
|
|
2918
|
+
resource is reachable only by its `$id`; a `$ref` that already resolves to that `$id` is left unchanged. The
|
|
2919
|
+
whole external resource is embedded once, keyed by its `$id`; `$anchor`, `$dynamicRef`, and `$dynamicAnchor`
|
|
2920
|
+
inside the embedded resource are preserved verbatim. Nested external `$ref`s inside an embedded resource are
|
|
2921
|
+
bundled the same way — the nested resource is embedded flat into the top-level `components.schemas`,
|
|
2922
|
+
deduplicated by resource URI, and the nested `$ref` is rebased onto its `$id` when needed. Internal Schema
|
|
2923
|
+
Object references are preserved untouched.
|
|
2924
|
+
|
|
2925
|
+
A Schema Object carried inside a hoisted component (a Response, Parameter, Request Body, Path Item, ...) changes
|
|
2926
|
+
its base URI on relocation — from the hoisted document's to the entry document's — so a location-based `$ref`
|
|
2927
|
+
in it is rewritten to address the embedded resource from the entry document: by the resource's declared `$id`,
|
|
2928
|
+
or, when the `$id` was assigned from the retrieval URI, by a URI reference relative to the entry document
|
|
2929
|
+
(e.g. `./pet.json` inside `responses/ok.json` becomes `responses/pet.json`), keeping any fragment. A `$ref`
|
|
2930
|
+
that resolves to the same URI from the entry document — under an absolute `$id`, or from a hoisted document
|
|
2931
|
+
sitting next to the entry document — is left as written.
|
|
2918
2932
|
|
|
2919
2933
|
Multiple references to the **same** external target are collapsed into a single component; distinct targets
|
|
2920
2934
|
each get their own component, even when their content happens to be identical. Internal Reference Objects are
|
|
@@ -2971,11 +2985,16 @@ The only external references Arazzo defines are **JSON Schema Objects** — a
|
|
|
2971
2985
|
external documents that are intentionally kept external — neither is bundled.) Schema Objects are therefore
|
|
2972
2986
|
bundled per the [JSON Schema Compound Document](https://json-schema.org/blog/posts/bundling-json-schema-compound-documents)
|
|
2973
2987
|
rules, exactly as in the `openapi-3-1` strategy: the external schema **resource** is embedded verbatim into
|
|
2974
|
-
`components.inputs` carrying its `$id
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
`
|
|
2988
|
+
`components.inputs` carrying its `$id`. A resource without a `$id` of its own is assigned one relative to the
|
|
2989
|
+
entry document's base URI (its `$self` when present), e.g. `schemas/ex.json`. The referencing
|
|
2990
|
+
`$ref` is **rebased** onto the embedded resource's `$id` (keeping any `$anchor` or JSON Pointer fragment)
|
|
2991
|
+
whenever it resolves to a different URI — e.g. `./ex.json#/$defs/Pet` becomes
|
|
2992
|
+
`https://example.com/schemas/pets#/$defs/Pet` — since once embedded the resource is reachable only by its `$id`;
|
|
2993
|
+
a `$ref` that already resolves to that `$id` is left unchanged. The whole external resource is embedded once,
|
|
2994
|
+
keyed by its `$id`; `$anchor`, `$dynamicRef`, and `$dynamicAnchor` inside the embedded resource are preserved
|
|
2995
|
+
verbatim. Nested external `$ref`s inside an embedded resource are bundled the same way — the nested resource is
|
|
2996
|
+
embedded flat into the top-level `components.inputs`, deduplicated by resource URI, and the nested `$ref` is
|
|
2997
|
+
rebased onto its `$id` when needed. Internal Schema Object references are preserved untouched.
|
|
2979
2998
|
Schema Object `$ref`s are resolved against the document's base URI — the Arazzo Object's `$self` field when
|
|
2980
2999
|
present (Arazzo 1.1.0), otherwise the retrieval URI — and references resolving into the entry document
|
|
2981
3000
|
(including by its `$self` identity) are treated as internal.
|