fumadocs-openapi 10.0.5 → 10.0.7
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.
|
@@ -41,4 +41,5 @@ export interface SchemaUIGeneratedData {
|
|
|
41
41
|
refs: Record<string, SchemaData>;
|
|
42
42
|
}
|
|
43
43
|
export declare function Schema({ ctx, root, ...props }: SchemaUIOptions & Omit<SchemaUIProps, 'generated'>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
44
|
+
export declare function generateSchemaUI({ ctx, root, }: SchemaUIOptions): SchemaUIGeneratedData;
|
|
44
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/schema/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;IAEvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAChC,CACI;IACE,IAAI,EAAE,WAAW,CAAC;CACnB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,KAAK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AO,CAAC;CACpB;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAChC,CACI;IACE,IAAI,EAAE,WAAW,CAAC;CACnB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,OAAO,CAAC;KACnB,EAAE,CAAC;CACL,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,GACD;IACE,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;CACL,CACJ,CAAC;AAEJ,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,aAAa,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CAClC;AAED,wBAAgB,MAAM,CAAC,EACrB,GAAG,EACH,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,8IAQpD;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,IAAI,GACL,EAAE,eAAe,GAAG,qBAAqB,CA0PzC"}
|
package/dist/ui/schema/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export function Schema({ ctx, root, ...props }) {
|
|
|
8
8
|
}
|
|
9
9
|
return (_jsx(SchemaUILazy, { ...props, generated: generateSchemaUI({ ctx, root }) }));
|
|
10
10
|
}
|
|
11
|
-
function generateSchemaUI({ ctx, root, }) {
|
|
11
|
+
export function generateSchemaUI({ ctx, root, }) {
|
|
12
12
|
const refs = {};
|
|
13
13
|
const { showExample = false } = ctx.schemaUI ?? {};
|
|
14
14
|
function generateInfoTags(schema) {
|
|
@@ -28,16 +28,16 @@ function generateSchemaUI({ ctx, root, }) {
|
|
|
28
28
|
if (schema.multipleOf) {
|
|
29
29
|
fields.push(field('Multiple Of', schema.multipleOf));
|
|
30
30
|
}
|
|
31
|
-
let range =
|
|
31
|
+
let range = formatRange('value', schema.minimum, schema.exclusiveMinimum, schema.maximum, schema.exclusiveMaximum);
|
|
32
32
|
if (range)
|
|
33
33
|
fields.push(field('Range', range));
|
|
34
|
-
range =
|
|
34
|
+
range = formatRange('length', schema.minLength, undefined, schema.maxLength, undefined);
|
|
35
35
|
if (range)
|
|
36
36
|
fields.push(field('Length', range));
|
|
37
|
-
range =
|
|
37
|
+
range = formatRange('properties', schema.minProperties, undefined, schema.maxProperties, undefined);
|
|
38
38
|
if (range)
|
|
39
39
|
fields.push(field('Properties', range));
|
|
40
|
-
range =
|
|
40
|
+
range = formatRange('items', schema.minItems, undefined, schema.maxItems, undefined);
|
|
41
41
|
if (range)
|
|
42
42
|
fields.push(field('Items', range));
|
|
43
43
|
if (schema.enum) {
|
|
@@ -129,6 +129,7 @@ function generateSchemaUI({ ctx, root, }) {
|
|
|
129
129
|
...schema,
|
|
130
130
|
...item,
|
|
131
131
|
};
|
|
132
|
+
delete extended['oneOf'];
|
|
132
133
|
scanRefs(key, extended);
|
|
133
134
|
out.items.push({
|
|
134
135
|
$type: key,
|
|
@@ -198,7 +199,7 @@ function generateSchemaUI({ ctx, root, }) {
|
|
|
198
199
|
$root,
|
|
199
200
|
};
|
|
200
201
|
}
|
|
201
|
-
function
|
|
202
|
+
function formatRange(value, min, exclusiveMin, max, exclusiveMax) {
|
|
202
203
|
const out = [];
|
|
203
204
|
if (min !== undefined) {
|
|
204
205
|
out.push(`${min} <=`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.7",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
55
55
|
"@radix-ui/react-select": "^2.2.6",
|
|
56
56
|
"@radix-ui/react-slot": "^1.2.4",
|
|
57
|
-
"@scalar/json-magic": "^0.
|
|
58
|
-
"@scalar/openapi-parser": "0.23.
|
|
57
|
+
"@scalar/json-magic": "^0.8.1",
|
|
58
|
+
"@scalar/openapi-parser": "0.23.2",
|
|
59
59
|
"ajv": "^8.17.1",
|
|
60
60
|
"class-variance-authority": "^0.7.1",
|
|
61
61
|
"github-slugger": "^2.0.0",
|
|
62
62
|
"gray-matter": "^4.0.3",
|
|
63
63
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
64
|
-
"js-yaml": "^4.1.
|
|
64
|
+
"js-yaml": "^4.1.1",
|
|
65
65
|
"next-themes": "^0.4.6",
|
|
66
66
|
"openapi-sampler": "^1.6.2",
|
|
67
67
|
"react-hook-form": "^7.66.0",
|
|
@@ -69,21 +69,21 @@
|
|
|
69
69
|
"remark-rehype": "^11.1.2",
|
|
70
70
|
"tinyglobby": "^0.2.15",
|
|
71
71
|
"xml-js": "^1.6.11",
|
|
72
|
-
"fumadocs-ui": "16.0.
|
|
73
|
-
"fumadocs-core": "16.0.
|
|
72
|
+
"fumadocs-ui": "16.0.12",
|
|
73
|
+
"fumadocs-core": "16.0.12"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@scalar/api-client-react": "^1.3.
|
|
76
|
+
"@scalar/api-client-react": "^1.3.50",
|
|
77
77
|
"@types/js-yaml": "^4.0.9",
|
|
78
|
-
"@types/node": "24.10.
|
|
78
|
+
"@types/node": "24.10.1",
|
|
79
79
|
"@types/openapi-sampler": "^1.0.3",
|
|
80
|
-
"@types/react": "^19.2.
|
|
80
|
+
"@types/react": "^19.2.5",
|
|
81
81
|
"json-schema-typed": "^8.0.1",
|
|
82
82
|
"openapi-types": "^12.1.3",
|
|
83
|
-
"tailwindcss": "^4.1.
|
|
83
|
+
"tailwindcss": "^4.1.17",
|
|
84
84
|
"tsc-alias": "^1.8.16",
|
|
85
|
-
"
|
|
86
|
-
"
|
|
85
|
+
"tsconfig": "0.0.0",
|
|
86
|
+
"eslint-config-custom": "0.0.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"@scalar/api-client-react": "*",
|