schema-components 1.18.1 → 1.20.0
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/dist/core/adapter.d.mts +2 -2
- package/dist/core/adapter.mjs +128 -15
- package/dist/core/constraints.d.mts +2 -2
- package/dist/core/diagnostics.d.mts +1 -1
- package/dist/core/errors.d.mts +1 -1
- package/dist/core/errors.mjs +15 -1
- package/dist/core/fieldOrder.d.mts +1 -1
- package/dist/core/formats.d.mts +21 -14
- package/dist/core/formats.mjs +96 -4
- package/dist/core/merge.d.mts +1 -1
- package/dist/core/normalise.d.mts +38 -5
- package/dist/core/normalise.mjs +2 -2
- package/dist/core/openapi30.d.mts +33 -4
- package/dist/core/openapi30.mjs +2 -2
- package/dist/core/ref.d.mts +1 -1
- package/dist/core/renderer.d.mts +1 -1
- package/dist/core/renderer.mjs +7 -2
- package/dist/core/swagger2.d.mts +1 -1
- package/dist/core/swagger2.mjs +1 -1
- package/dist/core/typeInference.d.mts +2 -2
- package/dist/core/types.d.mts +1 -1
- package/dist/core/uri.d.mts +41 -0
- package/dist/core/uri.mjs +76 -0
- package/dist/core/version.d.mts +2 -2
- package/dist/core/version.mjs +43 -9
- package/dist/core/walkBuilders.d.mts +3 -3
- package/dist/core/walker.d.mts +1 -1
- package/dist/core/walker.mjs +50 -3
- package/dist/{diagnostics-BYk63jsC.d.mts → diagnostics-CbBPsxSt.d.mts} +1 -1
- package/dist/{errors-C5zRC2PU.d.mts → errors-C2iABcn9.d.mts} +14 -2
- package/dist/html/a11y.d.mts +2 -2
- package/dist/html/renderToHtml.d.mts +2 -2
- package/dist/html/renderToHtmlStream.d.mts +2 -2
- package/dist/html/renderers.d.mts +2 -2
- package/dist/html/renderers.mjs +37 -2
- package/dist/html/streamRenderers.d.mts +2 -2
- package/dist/normalise-CMMEl4cd.mjs +1306 -0
- package/dist/openapi/ApiCallbacks.d.mts +1 -1
- package/dist/openapi/ApiLinks.d.mts +1 -1
- package/dist/openapi/ApiResponseHeaders.d.mts +1 -1
- package/dist/openapi/ApiSecurity.d.mts +1 -1
- package/dist/openapi/bundle.mjs +2 -0
- package/dist/openapi/components.d.mts +2 -2
- package/dist/openapi/components.mjs +20 -5
- package/dist/openapi/parser.d.mts +1 -1
- package/dist/openapi/parser.mjs +6 -1
- package/dist/openapi/resolve.d.mts +17 -6
- package/dist/openapi/resolve.mjs +45 -7
- package/dist/react/SchemaComponent.d.mts +21 -9
- package/dist/react/SchemaComponent.mjs +3 -13
- package/dist/react/SchemaView.d.mts +3 -3
- package/dist/react/SchemaView.mjs +1 -0
- package/dist/react/fieldPath.d.mts +1 -1
- package/dist/react/headless.d.mts +7 -1
- package/dist/react/headless.mjs +13 -1
- package/dist/react/headlessRenderers.d.mts +54 -3
- package/dist/react/headlessRenderers.mjs +153 -3
- package/dist/{ref-Ckt5liZs.d.mts → ref-C8JbwfiS.d.mts} +1 -1
- package/dist/{renderer-BAGoX4AK.d.mts → renderer-SOIbJBtk.d.mts} +9 -3
- package/dist/themes/mantine.d.mts +1 -1
- package/dist/themes/mui.d.mts +1 -1
- package/dist/themes/radix.d.mts +1 -1
- package/dist/themes/shadcn.d.mts +1 -1
- package/dist/{typeInference-5JiqIZ8t.d.mts → typeInference-CDoD_LZ_.d.mts} +187 -42
- package/dist/{types-D_5ST7SS.d.mts → types-C9zw9wbX.d.mts} +6 -0
- package/dist/{version-B5NV-35j.d.mts → version-D-u7aMfy.d.mts} +43 -1
- package/package.json +1 -1
- package/dist/normalise-tL9FckAk.mjs +0 -748
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
* before the walker processes the schema.
|
|
8
8
|
*/
|
|
9
9
|
type JsonSchemaDraft = "draft-04" | "draft-06" | "draft-07" | "draft-2019-09" | "draft-2020-12";
|
|
10
|
+
/**
|
|
11
|
+
* Match a `$schema` URI string to a known draft. Returns `undefined`
|
|
12
|
+
* when the URI matches none of the documented Draft 04 – Draft 2020-12
|
|
13
|
+
* schema URIs (including the known prefix patterns) — callers can use
|
|
14
|
+
* this to distinguish an authoritative match from a silent fallback.
|
|
15
|
+
*/
|
|
16
|
+
declare function matchJsonSchemaDraftUri(uri: string): JsonSchemaDraft | undefined;
|
|
10
17
|
/**
|
|
11
18
|
* Detect the JSON Schema draft version from a schema's `$schema` URI.
|
|
12
19
|
* When `$schema` is absent, uses heuristic keyword detection via
|
|
@@ -65,5 +72,40 @@ declare function isOpenApi31(version: OpenApiVersionInfo): boolean;
|
|
|
65
72
|
* Check if a document is Swagger 2.0.
|
|
66
73
|
*/
|
|
67
74
|
declare function isSwagger2(version: OpenApiVersionInfo): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Result of inspecting a document for the OpenAPI 3.1 `jsonSchemaDialect`
|
|
77
|
+
* keyword.
|
|
78
|
+
*
|
|
79
|
+
* - `kind: "absent"`: the keyword is not declared. The walker assumes
|
|
80
|
+
* Draft 2020-12, which is the spec-defined default.
|
|
81
|
+
* - `kind: "known"`: the declared dialect URI matches one of the
|
|
82
|
+
* supported drafts. The corresponding `JsonSchemaDraft` is returned so
|
|
83
|
+
* the normaliser can route to the matching per-node transforms.
|
|
84
|
+
* - `kind: "unknown"`: the keyword is present but its URI does not
|
|
85
|
+
* match any supported draft. The caller should emit an
|
|
86
|
+
* `unknown-json-schema-dialect` diagnostic and fall back to
|
|
87
|
+
* Draft 2020-12.
|
|
88
|
+
*/
|
|
89
|
+
type JsonSchemaDialectInfo = {
|
|
90
|
+
kind: "absent";
|
|
91
|
+
} | {
|
|
92
|
+
kind: "known";
|
|
93
|
+
uri: string;
|
|
94
|
+
draft: JsonSchemaDraft;
|
|
95
|
+
} | {
|
|
96
|
+
kind: "unknown";
|
|
97
|
+
uri: string;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Inspect an OpenAPI 3.1 document for a `jsonSchemaDialect` declaration.
|
|
101
|
+
*
|
|
102
|
+
* Per the OpenAPI 3.1 spec, an OpenAPI document may declare the default
|
|
103
|
+
* JSON Schema dialect for its Schema Objects via the top-level
|
|
104
|
+
* `jsonSchemaDialect` URI. Real-world 3.1 documents overwhelmingly omit
|
|
105
|
+
* the keyword and rely on the spec-defined Draft 2020-12 default — this
|
|
106
|
+
* helper surfaces the declaration so the normaliser can either honour a
|
|
107
|
+
* known dialect or emit a diagnostic for an unknown one.
|
|
108
|
+
*/
|
|
109
|
+
declare function readJsonSchemaDialect(doc: Record<string, unknown>): JsonSchemaDialectInfo;
|
|
68
110
|
//#endregion
|
|
69
|
-
export {
|
|
111
|
+
export { detectJsonSchemaDraft as a, inferJsonSchemaDraftWithReason as c, isSwagger2 as d, matchJsonSchemaDraftUri as f, OpenApiVersionInfo as i, isOpenApi30 as l, JsonSchemaDialectInfo as n, detectOpenApiVersion as o, readJsonSchemaDialect as p, JsonSchemaDraft as r, inferJsonSchemaDraft as s, InferredDraft as t, isOpenApi31 as u };
|