@scalar/openapi-to-markdown 1.1.0 → 1.3.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/CHANGELOG.md +34 -0
- package/dist/get-markdown-examples.d.ts +12 -1
- package/dist/get-markdown-examples.d.ts.map +1 -1
- package/dist/get-markdown-examples.js +83 -4
- package/dist/load-document.d.ts.map +1 -1
- package/dist/load-document.js +120 -42
- package/dist/object-kinds.d.ts +14 -0
- package/dist/object-kinds.d.ts.map +1 -0
- package/dist/object-kinds.js +70 -0
- package/dist/render-document.d.ts.map +1 -1
- package/dist/render-document.js +6 -2
- package/dist/render-examples.d.ts +1 -1
- package/dist/render-examples.d.ts.map +1 -1
- package/dist/render-examples.js +32 -11
- package/dist/render-operation-details.d.ts +2 -2
- package/dist/render-operation-details.d.ts.map +1 -1
- package/dist/render-operation-details.js +5 -5
- package/dist/render-operation.d.ts.map +1 -1
- package/dist/render-operation.js +10 -11
- package/dist/render-schema.d.ts +20 -2
- package/dist/render-schema.d.ts.map +1 -1
- package/dist/render-schema.js +175 -67
- package/dist/restore-boolean-schemas.d.ts +8 -1
- package/dist/restore-boolean-schemas.d.ts.map +1 -1
- package/dist/restore-boolean-schemas.js +42 -38
- package/dist/select-document.d.ts +3 -3
- package/dist/select-document.d.ts.map +1 -1
- package/dist/select-document.js +56 -35
- package/package.json +5 -5
|
@@ -3,9 +3,9 @@ import type { RootContent } from 'mdast';
|
|
|
3
3
|
import type { DescriptionParser } from './parse-description.js';
|
|
4
4
|
import type { SchemaRenderer } from './render-schema.js';
|
|
5
5
|
/** Render response or multipart headers, whose names come from their containing map. */
|
|
6
|
-
export declare const renderHeaders: (headers: ResponseObject["headers"], description: DescriptionParser, schemas: SchemaRenderer, openapiVersion: string) => Promise<RootContent[]>;
|
|
6
|
+
export declare const renderHeaders: (headers: ResponseObject["headers"], description: DescriptionParser, schemas: SchemaRenderer, openapiVersion: string, schemaOpenapiVersion?: string) => Promise<RootContent[]>;
|
|
7
7
|
/** Preserve explicit encoding settings, including false flags and part headers. */
|
|
8
|
-
export declare const renderEncoding: (encoding: Record<string, EncodingObject> | undefined, mediaType: string, description: DescriptionParser, schemas: SchemaRenderer, openapiVersion: string) => Promise<RootContent[]>;
|
|
8
|
+
export declare const renderEncoding: (encoding: Record<string, EncodingObject> | undefined, mediaType: string, description: DescriptionParser, schemas: SchemaRenderer, openapiVersion: string, schemaOpenapiVersion?: string) => Promise<RootContent[]>;
|
|
9
9
|
/** Render response link expressions as literal values, without evaluating them. */
|
|
10
10
|
export declare const renderResponseLinks: (links: ResponseObject["links"], description: DescriptionParser) => Promise<RootContent[]>;
|
|
11
11
|
//# sourceMappingURL=render-operation-details.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-operation-details.d.ts","sourceRoot":"","sources":["../src/render-operation-details.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAA;AAClH,OAAO,KAAK,EAAY,WAAW,EAAE,MAAM,OAAO,CAAA;AAGlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,wFAAwF;AACxF,eAAO,MAAM,aAAa,GACxB,SAAS,cAAc,CAAC,SAAS,CAAC,EAClC,aAAa,iBAAiB,EAC9B,SAAS,cAAc,EACvB,gBAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"render-operation-details.d.ts","sourceRoot":"","sources":["../src/render-operation-details.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAA;AAClH,OAAO,KAAK,EAAY,WAAW,EAAE,MAAM,OAAO,CAAA;AAGlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,wFAAwF;AACxF,eAAO,MAAM,aAAa,GACxB,SAAS,cAAc,CAAC,SAAS,CAAC,EAClC,aAAa,iBAAiB,EAC9B,SAAS,cAAc,EACvB,gBAAgB,MAAM,EACtB,6BAAqC,KACpC,OAAO,CAAC,WAAW,EAAE,CA0CvB,CAAA;AAED,mFAAmF;AACnF,eAAO,MAAM,cAAc,GACzB,UAAU,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,SAAS,EACpD,WAAW,MAAM,EACjB,aAAa,iBAAiB,EAC9B,SAAS,cAAc,EACvB,gBAAgB,MAAM,EACtB,6BAAqC,KACpC,OAAO,CAAC,WAAW,EAAE,CA6BvB,CAAA;AAID,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,GAC9B,OAAO,cAAc,CAAC,OAAO,CAAC,EAC9B,aAAa,iBAAiB,KAC7B,OAAO,CAAC,WAAW,EAAE,CA2BvB,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/
|
|
|
2
2
|
import { inlineCode, item, list, paragraph, strong, text } from './markdown-nodes.js';
|
|
3
3
|
import { renderExamples } from './render-examples.js';
|
|
4
4
|
/** Render response or multipart headers, whose names come from their containing map. */
|
|
5
|
-
export const renderHeaders = async (headers, description, schemas, openapiVersion) => {
|
|
5
|
+
export const renderHeaders = async (headers, description, schemas, openapiVersion, schemaOpenapiVersion = openapiVersion) => {
|
|
6
6
|
const entries = [];
|
|
7
7
|
for (const [name, reference] of Object.entries(headers ?? {})) {
|
|
8
8
|
// OpenAPI reserves Content-Type for the media type map / encoding field.
|
|
@@ -18,20 +18,20 @@ export const renderHeaders = async (headers, description, schemas, openapiVersio
|
|
|
18
18
|
if ('schema' in header && header.schema !== undefined)
|
|
19
19
|
blocks.push(...schemas.render(header.schema));
|
|
20
20
|
if ('example' in header || 'examples' in header) {
|
|
21
|
-
blocks.push(...(await renderExamples({ example: header.example, examples: header.examples }, description, 'application/json', undefined, openapiVersion)));
|
|
21
|
+
blocks.push(...(await renderExamples({ example: header.example, examples: header.examples }, description, 'application/json', undefined, openapiVersion, schemaOpenapiVersion)));
|
|
22
22
|
}
|
|
23
23
|
for (const [mediaType, content] of Object.entries('content' in header ? (header.content ?? {}) : {})) {
|
|
24
24
|
blocks.push(paragraph(strong(text('Content-Type:')), text(` ${mediaType}`)));
|
|
25
25
|
if (content.schema !== undefined)
|
|
26
26
|
blocks.push(...schemas.render(content.schema));
|
|
27
|
-
blocks.push(...(await renderExamples(content, description, mediaType, undefined, openapiVersion)));
|
|
27
|
+
blocks.push(...(await renderExamples(content, description, mediaType, undefined, openapiVersion, schemaOpenapiVersion)));
|
|
28
28
|
}
|
|
29
29
|
entries.push(item(...blocks));
|
|
30
30
|
}
|
|
31
31
|
return entries.length ? [paragraph(strong(text('Headers:'))), list(entries)] : [];
|
|
32
32
|
};
|
|
33
33
|
/** Preserve explicit encoding settings, including false flags and part headers. */
|
|
34
|
-
export const renderEncoding = async (encoding, mediaType, description, schemas, openapiVersion) => {
|
|
34
|
+
export const renderEncoding = async (encoding, mediaType, description, schemas, openapiVersion, schemaOpenapiVersion = openapiVersion) => {
|
|
35
35
|
const multipart = mediaType.startsWith('multipart/');
|
|
36
36
|
if (!multipart && mediaType !== 'application/x-www-form-urlencoded')
|
|
37
37
|
return [];
|
|
@@ -51,7 +51,7 @@ export const renderEncoding = async (encoding, mediaType, description, schemas,
|
|
|
51
51
|
if (fields.length)
|
|
52
52
|
blocks.push(list(fields));
|
|
53
53
|
if (multipart)
|
|
54
|
-
blocks.push(...(await renderHeaders(entry.headers, description, schemas, openapiVersion)));
|
|
54
|
+
blocks.push(...(await renderHeaders(entry.headers, description, schemas, openapiVersion, schemaOpenapiVersion)));
|
|
55
55
|
entries.push(item(...blocks));
|
|
56
56
|
}
|
|
57
57
|
return entries.length ? [paragraph(strong(text('Encoding:'))), list(entries)] : [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-operation.d.ts","sourceRoot":"","sources":["../src/render-operation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render-operation.d.ts","sourceRoot":"","sources":["../src/render-operation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAEf,cAAc,EAGf,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAY,WAAW,EAAE,MAAM,OAAO,CAAA;AAGlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAG5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGrD,oEAAoE;AACpE,KAAK,aAAa,GAAG;IACnB,WAAW,EAAE,iBAAiB,CAAA;IAC9B,OAAO,EAAE,cAAc,CAAA;CACxB,CAAA;AAED,iFAAiF;AACjF,eAAO,MAAM,eAAe,GAC1B,UAAU,eAAe,EACzB,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd,UAAU,cAAc,EACxB,WAAW,eAAe,EAC1B,SAAS,OAAO,EAChB,0BAA0B,aAAa,KACtC,OAAO,CAAC,WAAW,EAAE,CA4GvB,CAAA"}
|
package/dist/render-operation.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isHttpMethod } from '@scalar/helpers/http/is-http-method';
|
|
1
2
|
import { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/helpers/get-resolved-ref';
|
|
2
3
|
import { field, heading, inlineCode, item, list, paragraph, strong, text } from './markdown-nodes.js';
|
|
3
4
|
import { renderExamples } from './render-examples.js';
|
|
@@ -5,14 +6,12 @@ import { renderEncoding, renderHeaders, renderResponseLinks } from './render-ope
|
|
|
5
6
|
import { renderSecurity } from './render-security.js';
|
|
6
7
|
/** Render effective operation context without mutating the prepared document. */
|
|
7
8
|
export const renderOperation = async (document, path, method, pathItem, operation, webhook, { description, schemas }) => {
|
|
9
|
+
const displayMethod = method === method.toLowerCase() && isHttpMethod(method) ? method.toUpperCase() : method;
|
|
8
10
|
const openapiVersion = document['x-original-oas-version'] ?? document.openapi;
|
|
9
11
|
const stability = operation['x-scalar-stability'];
|
|
10
|
-
const title = (operation.summary || `${
|
|
12
|
+
const title = (operation.summary || `${displayMethod} ${path}`) +
|
|
11
13
|
(stability ? ` (${stability})` : operation.deprecated ? ' ⚠️ Deprecated' : '');
|
|
12
|
-
const metadata = [
|
|
13
|
-
field('Method', inlineCode(method.toUpperCase())),
|
|
14
|
-
field(webhook ? 'Webhook' : 'Path', inlineCode(path)),
|
|
15
|
-
];
|
|
14
|
+
const metadata = [field('Method', inlineCode(displayMethod)), field(webhook ? 'Webhook' : 'Path', inlineCode(path))];
|
|
16
15
|
if (operation.operationId)
|
|
17
16
|
metadata.push(field('Operation ID', inlineCode(operation.operationId)));
|
|
18
17
|
if (operation.tags)
|
|
@@ -60,12 +59,12 @@ export const renderOperation = async (document, path, method, pathItem, operatio
|
|
|
60
59
|
if ('schema' in parameter && parameter.schema !== undefined)
|
|
61
60
|
nodes.push(...schemas.render(parameter.schema));
|
|
62
61
|
if ('example' in parameter || 'examples' in parameter)
|
|
63
|
-
nodes.push(...(await renderExamples({ example: parameter.example, examples: parameter.examples }, description, 'application/json', 'write', openapiVersion)));
|
|
62
|
+
nodes.push(...(await renderExamples({ example: parameter.example, examples: parameter.examples }, description, 'application/json', 'write', openapiVersion, document.openapi)));
|
|
64
63
|
for (const [mediaType, content] of Object.entries('content' in parameter ? (parameter.content ?? {}) : {})) {
|
|
65
64
|
nodes.push(heading(6, text(`Content-Type: ${mediaType}`)));
|
|
66
65
|
if (content.schema !== undefined)
|
|
67
66
|
nodes.push(...schemas.render(content.schema));
|
|
68
|
-
nodes.push(...(await renderExamples(content, description, mediaType, 'write', openapiVersion)));
|
|
67
|
+
nodes.push(...(await renderExamples(content, description, mediaType, 'write', openapiVersion, document.openapi)));
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
const body = getResolvedRef(operation.requestBody, mergeSiblingReferences);
|
|
@@ -77,8 +76,8 @@ export const renderOperation = async (document, path, method, pathItem, operatio
|
|
|
77
76
|
nodes.push(heading(5, text(`Content-Type: ${mediaType}`)));
|
|
78
77
|
if (content.schema !== undefined)
|
|
79
78
|
nodes.push(...schemas.render(content.schema));
|
|
80
|
-
nodes.push(...(await renderExamples(content, description, mediaType, 'write', openapiVersion)));
|
|
81
|
-
nodes.push(...(await renderEncoding(content.encoding, mediaType, description, schemas, openapiVersion)));
|
|
79
|
+
nodes.push(...(await renderExamples(content, description, mediaType, 'write', openapiVersion, document.openapi)));
|
|
80
|
+
nodes.push(...(await renderEncoding(content.encoding, mediaType, description, schemas, openapiVersion, document.openapi)));
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
const responses = Object.entries(operation.responses ?? {}).flatMap(([status, reference]) => {
|
|
@@ -89,12 +88,12 @@ export const renderOperation = async (document, path, method, pathItem, operatio
|
|
|
89
88
|
nodes.push(heading(4, text('Responses')));
|
|
90
89
|
for (const { status, response } of responses) {
|
|
91
90
|
nodes.push(heading(5, text(`Status: ${status}${response.description ? ` ${response.description}` : ''}`)));
|
|
92
|
-
nodes.push(...(await renderHeaders(response.headers, description, schemas, openapiVersion)), ...(await renderResponseLinks(response.links, description)));
|
|
91
|
+
nodes.push(...(await renderHeaders(response.headers, description, schemas, openapiVersion, document.openapi)), ...(await renderResponseLinks(response.links, description)));
|
|
93
92
|
for (const [mediaType, content] of Object.entries(response.content ?? {})) {
|
|
94
93
|
nodes.push(heading(6, text(`Content-Type: ${mediaType}`)));
|
|
95
94
|
if (content.schema !== undefined)
|
|
96
95
|
nodes.push(...schemas.render(content.schema));
|
|
97
|
-
nodes.push(...(await renderExamples(content, description, mediaType, 'read', openapiVersion)));
|
|
96
|
+
nodes.push(...(await renderExamples(content, description, mediaType, 'read', openapiVersion, document.openapi)));
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
return nodes;
|
package/dist/render-schema.d.ts
CHANGED
|
@@ -38,18 +38,36 @@ type SchemaView = {
|
|
|
38
38
|
propertyName: string;
|
|
39
39
|
mapping?: Record<string, string>;
|
|
40
40
|
};
|
|
41
|
+
/** Set for references to a structured schema that is rendered once per document and referred to afterwards. */
|
|
42
|
+
name?: string;
|
|
41
43
|
};
|
|
42
44
|
type RenderOptions = {
|
|
43
45
|
hideDescription?: boolean;
|
|
44
46
|
hideDetails?: boolean;
|
|
45
47
|
property?: boolean;
|
|
48
|
+
/** Record this root under the given name, for example in its own model section, even if it is not a reference. */
|
|
49
|
+
name?: string;
|
|
46
50
|
};
|
|
47
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Schema normalization is cached separately from ancestry-dependent expansion.
|
|
53
|
+
*
|
|
54
|
+
* A renderer also tracks which shared schemas one output document already shows, so each one is
|
|
55
|
+
* expanded once and referred to afterwards. Use `forDocument` for every document: renders can
|
|
56
|
+
* run concurrently, and each needs its own record.
|
|
57
|
+
*/
|
|
48
58
|
export type SchemaRenderer = {
|
|
49
59
|
view: (schema: MarkdownSchema) => SchemaView;
|
|
50
60
|
render: (schema: MarkdownSchema, depth?: number, ancestors?: readonly unknown[], options?: RenderOptions) => RootContent[];
|
|
61
|
+
/** Restore the node budget, for example for each operation or model section. */
|
|
62
|
+
beginSection: () => void;
|
|
63
|
+
/** Start a document that shares normalized views, given the models it renders in its own sections. */
|
|
64
|
+
forDocument: (models?: Record<string, MarkdownSchema>) => SchemaRenderer;
|
|
65
|
+
};
|
|
66
|
+
type SchemaRendererOptions = {
|
|
67
|
+
/** Upper bound on expanded schema nodes per section, so no description can make a page unbounded. */
|
|
68
|
+
maxNodes?: number;
|
|
51
69
|
};
|
|
52
70
|
/** Keep merged reference siblings and sorted properties stable throughout an export. */
|
|
53
|
-
export declare const createSchemaRenderer: () => SchemaRenderer;
|
|
71
|
+
export declare const createSchemaRenderer: ({ maxNodes }?: SchemaRendererOptions) => SchemaRenderer;
|
|
54
72
|
export {};
|
|
55
73
|
//# sourceMappingURL=render-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-schema.d.ts","sourceRoot":"","sources":["../src/render-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render-schema.d.ts","sourceRoot":"","sources":["../src/render-schema.ts"],"names":[],"mappings":"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"}
|
package/dist/render-schema.js
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
|
+
import { unescapeJsonPointer } from '@scalar/helpers/json/unescape-json-pointer';
|
|
1
2
|
import { isObject } from '@scalar/helpers/object/is-object';
|
|
2
3
|
import { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/helpers/get-resolved-ref';
|
|
3
4
|
import { inlineCode, item, list, paragraph, strong, text } from './markdown-nodes.js';
|
|
5
|
+
/** Guards against stack exhaustion. Past it, references to models point to their own section instead. */
|
|
6
|
+
const MAX_DEPTH = 64;
|
|
7
|
+
/**
|
|
8
|
+
* Deduplicated output is proportional to the schema graph, so only a pathological description
|
|
9
|
+
* (for example a YAML alias graph without references) reaches this.
|
|
10
|
+
*/
|
|
11
|
+
const MAX_NODES = 100_000;
|
|
12
|
+
/** Keywords that `render` expands, as opposed to annotations that `details` prints on one line. */
|
|
13
|
+
const structuralKeywords = new Set([
|
|
14
|
+
'allOf',
|
|
15
|
+
'anyOf',
|
|
16
|
+
'oneOf',
|
|
17
|
+
'not',
|
|
18
|
+
'properties',
|
|
19
|
+
'required',
|
|
20
|
+
'items',
|
|
21
|
+
'additionalProperties',
|
|
22
|
+
'discriminator',
|
|
23
|
+
'minItems',
|
|
24
|
+
'maxItems',
|
|
25
|
+
'uniqueItems',
|
|
26
|
+
]);
|
|
27
|
+
/** Link bookkeeping that is not a sibling keyword of a reference. */
|
|
28
|
+
const referenceKeys = new Set(['$ref', '$ref-value', '$global', '$status']);
|
|
29
|
+
const emphasis = (...children) => ({ type: 'emphasis', children });
|
|
30
|
+
/** Prefer the component name, which is how model sections and other references identify the schema. */
|
|
31
|
+
const getReferenceName = (ref) => {
|
|
32
|
+
const match = /^#\/components\/schemas\/([^/]+)$/.exec(ref);
|
|
33
|
+
if (!match)
|
|
34
|
+
return ref;
|
|
35
|
+
try {
|
|
36
|
+
return unescapeJsonPointer(match[1]);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return ref;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/** Only references that add nothing structural can be replaced by the schema they point to. */
|
|
43
|
+
const getSharedName = (input, view) => {
|
|
44
|
+
const ref = isObject(input) ? input.$ref : undefined;
|
|
45
|
+
if (typeof ref !== 'string' || typeof view.schema !== 'object')
|
|
46
|
+
return undefined;
|
|
47
|
+
if (Object.keys(input).some((key) => structuralKeywords.has(key)))
|
|
48
|
+
return undefined;
|
|
49
|
+
const structured = Boolean(view.allOf?.length || view.anyOf?.length || view.oneOf?.length || view.properties.length) ||
|
|
50
|
+
view.not !== undefined ||
|
|
51
|
+
view.items !== undefined ||
|
|
52
|
+
view.additionalProperties !== undefined;
|
|
53
|
+
// Leaf schemas are as short as a reference to them, so they stay in place.
|
|
54
|
+
return structured ? getReferenceName(ref) : undefined;
|
|
55
|
+
};
|
|
4
56
|
/** Boolean targets still combine with adjacent schema keywords. */
|
|
5
57
|
const resolveMarkdownSchema = (input) => {
|
|
6
58
|
const target = getResolvedRef(input);
|
|
@@ -16,7 +68,7 @@ const resolveMarkdownSchema = (input) => {
|
|
|
16
68
|
return { ...merged, allOf: [false, ...(Array.isArray(merged.allOf) ? merged.allOf : [])] };
|
|
17
69
|
};
|
|
18
70
|
/** Keep merged reference siblings and sorted properties stable throughout an export. */
|
|
19
|
-
export const createSchemaRenderer = () => {
|
|
71
|
+
export const createSchemaRenderer = ({ maxNodes = MAX_NODES } = {}) => {
|
|
20
72
|
const views = new WeakMap();
|
|
21
73
|
const view = (input) => {
|
|
22
74
|
const cached = typeof input === 'object' ? views.get(input) : undefined;
|
|
@@ -37,6 +89,7 @@ export const createSchemaRenderer = () => {
|
|
|
37
89
|
required,
|
|
38
90
|
properties,
|
|
39
91
|
};
|
|
92
|
+
result.name = getSharedName(input, result);
|
|
40
93
|
if (typeof input === 'object')
|
|
41
94
|
views.set(input, result);
|
|
42
95
|
return result;
|
|
@@ -50,6 +103,8 @@ export const createSchemaRenderer = () => {
|
|
|
50
103
|
if (entry !== undefined)
|
|
51
104
|
nodes.push(text(`${nodes.length ? ', ' : ''}${label}: `), inlineCode(entry));
|
|
52
105
|
};
|
|
106
|
+
// Later references to a shared schema point back to this name.
|
|
107
|
+
add('schema', value.name);
|
|
53
108
|
add('format', value.format);
|
|
54
109
|
if (value.enum)
|
|
55
110
|
add('possible values', value.enum.map((entry) => JSON.stringify(entry)).join(', '));
|
|
@@ -78,71 +133,124 @@ export const createSchemaRenderer = () => {
|
|
|
78
133
|
nodes.push(text(`${nodes.length ? ' — ' : ''}${value.description}`));
|
|
79
134
|
return nodes;
|
|
80
135
|
};
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
136
|
+
const forDocument = (models = {}) => {
|
|
137
|
+
/** Shared schemas this document already expanded, with the name later references use. */
|
|
138
|
+
const shown = new Map();
|
|
139
|
+
/** Models that the document renders in their own sections after the operations. */
|
|
140
|
+
const sections = new Set(Object.values(models).map((model) => getResolvedRef(model) ?? model));
|
|
141
|
+
let nodeCount = 0;
|
|
142
|
+
/** Refer to a schema expanded elsewhere, keeping annotations the reference itself adds. */
|
|
143
|
+
const reference = (input, value, options, name, location) => {
|
|
144
|
+
const nodes = [];
|
|
145
|
+
const siblings = isObject(input) && Object.keys(input).some((key) => !referenceKeys.has(key));
|
|
146
|
+
if (siblings && !options.hideDetails) {
|
|
147
|
+
const annotations = details({ ...value, name: undefined }, false, options.hideDescription);
|
|
148
|
+
if (annotations.length)
|
|
149
|
+
nodes.push(paragraph(...annotations));
|
|
150
|
+
}
|
|
151
|
+
nodes.push(paragraph(emphasis(text('Schema '), inlineCode(name), text(` is shown ${location}.`))));
|
|
152
|
+
return nodes;
|
|
153
|
+
};
|
|
154
|
+
const render = (input, depth = 0, ancestors = [], options = {}) => {
|
|
155
|
+
// Follow the original target: merging reference siblings creates fresh objects.
|
|
156
|
+
const identity = getResolvedRef(input) ?? input;
|
|
157
|
+
if (typeof identity === 'object' && ancestors.includes(identity)) {
|
|
158
|
+
return [paragraph(emphasis(text('[Circular Reference]')))];
|
|
159
|
+
}
|
|
160
|
+
const value = view(input);
|
|
161
|
+
// A named model with structural reference siblings is its own schema, not another
|
|
162
|
+
// occurrence of its target. Otherwise either rendering order can hide properties.
|
|
163
|
+
const sharedIdentity = isObject(input) && '$ref' in input && Object.keys(input).some((key) => structuralKeywords.has(key))
|
|
164
|
+
? input
|
|
165
|
+
: identity;
|
|
166
|
+
const shared = typeof sharedIdentity === 'object' && sharedIdentity !== null ? sharedIdentity : undefined;
|
|
167
|
+
const name = options.name ?? value.name;
|
|
168
|
+
if (shared && name !== undefined) {
|
|
169
|
+
// Expanding every path through a shared schema grows exponentially, so expand it once.
|
|
170
|
+
const previous = shown.get(shared);
|
|
171
|
+
if (previous !== undefined) {
|
|
172
|
+
// A model section already prints its own annotations above the schema.
|
|
173
|
+
const referenceOptions = options.name === undefined ? options : { ...options, hideDetails: true };
|
|
174
|
+
return reference(input, value, referenceOptions, previous, 'above');
|
|
175
|
+
}
|
|
176
|
+
if (value.name !== undefined && options.name === undefined && depth >= MAX_DEPTH && sections.has(shared))
|
|
177
|
+
return reference(input, value, options, value.name, 'below under Schemas');
|
|
178
|
+
}
|
|
179
|
+
if (depth >= MAX_DEPTH)
|
|
180
|
+
return [paragraph(text('[Maximum schema depth reached]'))];
|
|
181
|
+
if (nodeCount >= maxNodes)
|
|
182
|
+
return [paragraph(emphasis(text('[Schema output truncated]')))];
|
|
183
|
+
nodeCount++;
|
|
184
|
+
if (shared && name !== undefined && !shown.has(shared))
|
|
185
|
+
shown.set(shared, name);
|
|
186
|
+
if (typeof value.schema === 'boolean')
|
|
187
|
+
return options.hideDetails ? [] : [paragraph(...details(value))];
|
|
188
|
+
const childAncestors = [...ancestors, identity];
|
|
189
|
+
const nodes = [];
|
|
190
|
+
for (const [key, label] of [
|
|
191
|
+
['allOf', 'All of:'],
|
|
192
|
+
['anyOf', 'Any of:'],
|
|
193
|
+
['oneOf', 'One of:'],
|
|
194
|
+
]) {
|
|
195
|
+
if (value[key]?.length)
|
|
196
|
+
nodes.push(paragraph(strong(text(label))), ...value[key].flatMap((child) => render(child, depth + 1, childAncestors)));
|
|
197
|
+
}
|
|
198
|
+
if (value.not !== undefined)
|
|
199
|
+
nodes.push(paragraph(strong(text('Not:'))), ...render(value.not, depth + 1, childAncestors));
|
|
200
|
+
const array = value.type === 'array' || value.items !== undefined;
|
|
201
|
+
if (!options.hideDetails) {
|
|
202
|
+
// Child sections imply a single container type, but never its nullable alternatives.
|
|
203
|
+
const impliedType = (value.type === 'object' && value.properties.length > 0) ||
|
|
204
|
+
(value.type === 'array' && value.items !== undefined);
|
|
205
|
+
const annotations = details(value, false, options.hideDescription, !impliedType);
|
|
206
|
+
if (annotations.length)
|
|
207
|
+
nodes.push(paragraph(...annotations));
|
|
208
|
+
}
|
|
209
|
+
if (value.properties.length) {
|
|
210
|
+
const properties = value.properties.map(([name, schema]) => {
|
|
211
|
+
const child = view(schema);
|
|
212
|
+
const label = [inlineCode(name)];
|
|
213
|
+
if (value.required.has(name))
|
|
214
|
+
label.push(text(' (required)'));
|
|
215
|
+
const blocks = [paragraph(strong(...label)), paragraph(...details(child, true))];
|
|
216
|
+
blocks.push(...render(schema, depth + 1, childAncestors, {
|
|
217
|
+
hideDetails: true,
|
|
218
|
+
property: true,
|
|
219
|
+
}));
|
|
220
|
+
return item(...blocks);
|
|
221
|
+
});
|
|
222
|
+
nodes.push(list(properties));
|
|
223
|
+
}
|
|
224
|
+
if (array && value.items !== undefined) {
|
|
225
|
+
nodes.push(paragraph(strong(text(options.property ? 'Items:' : 'Array of:'))), ...render(value.items, depth + 1, childAncestors));
|
|
226
|
+
}
|
|
227
|
+
const constraints = [];
|
|
228
|
+
if (value.minItems !== undefined)
|
|
229
|
+
constraints.push(item(paragraph(text('Min items: '), inlineCode(value.minItems))));
|
|
230
|
+
if (value.maxItems !== undefined)
|
|
231
|
+
constraints.push(item(paragraph(text('Max items: '), inlineCode(value.maxItems))));
|
|
232
|
+
if (value.uniqueItems !== undefined)
|
|
233
|
+
constraints.push(item(paragraph(text('Unique items: '), inlineCode(value.uniqueItems))));
|
|
234
|
+
if (constraints.length)
|
|
235
|
+
nodes.push(list(constraints));
|
|
236
|
+
if (value.additionalProperties !== undefined)
|
|
237
|
+
nodes.push(paragraph(strong(text('Additional properties:'))), ...render(value.additionalProperties, depth + 1, childAncestors));
|
|
238
|
+
if (value.discriminator) {
|
|
239
|
+
nodes.push(paragraph(strong(text('Discriminator:')), text(' '), inlineCode(value.discriminator.propertyName)));
|
|
240
|
+
const mappings = Object.entries(value.discriminator.mapping ?? {});
|
|
241
|
+
if (mappings.length)
|
|
242
|
+
nodes.push(list(mappings.map(([name, target]) => item(paragraph(inlineCode(name), text(': '), inlineCode(target))))));
|
|
243
|
+
}
|
|
244
|
+
return nodes;
|
|
245
|
+
};
|
|
246
|
+
return {
|
|
247
|
+
view,
|
|
248
|
+
render,
|
|
249
|
+
beginSection: () => {
|
|
250
|
+
nodeCount = 0;
|
|
251
|
+
},
|
|
252
|
+
forDocument,
|
|
253
|
+
};
|
|
146
254
|
};
|
|
147
|
-
return
|
|
255
|
+
return forDocument();
|
|
148
256
|
};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
/** Where a value sits in an OpenAPI description: a schema, a map of schemas, or anything else. */
|
|
2
|
+
export type SchemaPosition = 'document' | 'schema' | 'map';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the position of the value stored under `key`, or `undefined` when that value
|
|
5
|
+
* is not part of the schema tree, such as example payloads and schema metadata.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getChildPosition: (position: SchemaPosition, key: string) => SchemaPosition | undefined;
|
|
1
8
|
/**
|
|
2
9
|
* The workspace schema currently casts boolean JSON Schemas into empty objects.
|
|
3
10
|
* Restore them only in schema positions, never in example payloads or metadata.
|
|
4
11
|
* TODO: Remove this bridge when the shared schema accepts boolean JSON Schemas.
|
|
5
12
|
*/
|
|
6
|
-
export declare const restoreBooleanSchemas: (source: unknown, target: unknown) => void;
|
|
13
|
+
export declare const restoreBooleanSchemas: (source: unknown, target: unknown, position?: SchemaPosition) => void;
|
|
7
14
|
//# sourceMappingURL=restore-boolean-schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restore-boolean-schemas.d.ts","sourceRoot":"","sources":["../src/restore-boolean-schemas.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"restore-boolean-schemas.d.ts","sourceRoot":"","sources":["../src/restore-boolean-schemas.ts"],"names":[],"mappings":"AAEA,kGAAkG;AAClG,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAA;AAmB1D;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU,cAAc,EAAE,KAAK,MAAM,KAAG,cAAc,GAAG,SAWzF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,OAAO,EACf,QAAQ,OAAO,EACf,WAAU,cAA2B,KACpC,IA2BF,CAAA"}
|
|
@@ -1,46 +1,50 @@
|
|
|
1
1
|
import { isObject } from '@scalar/helpers/object/is-object';
|
|
2
|
+
const schemaMaps = new Set(['properties', 'patternProperties', '$defs', 'definitions', 'dependentSchemas']);
|
|
3
|
+
const schemaArrays = new Set(['allOf', 'anyOf', 'oneOf', 'prefixItems']);
|
|
4
|
+
const schemaFields = new Set([
|
|
5
|
+
'items',
|
|
6
|
+
'not',
|
|
7
|
+
'additionalProperties',
|
|
8
|
+
'additionalItems',
|
|
9
|
+
'contains',
|
|
10
|
+
'contentSchema',
|
|
11
|
+
'propertyNames',
|
|
12
|
+
'if',
|
|
13
|
+
'then',
|
|
14
|
+
'else',
|
|
15
|
+
'unevaluatedProperties',
|
|
16
|
+
'unevaluatedItems',
|
|
17
|
+
]);
|
|
18
|
+
/**
|
|
19
|
+
* Returns the position of the value stored under `key`, or `undefined` when that value
|
|
20
|
+
* is not part of the schema tree, such as example payloads and schema metadata.
|
|
21
|
+
*/
|
|
22
|
+
export const getChildPosition = (position, key) => {
|
|
23
|
+
if (position === 'map')
|
|
24
|
+
return 'schema';
|
|
25
|
+
if (position === 'schema') {
|
|
26
|
+
if (schemaMaps.has(key))
|
|
27
|
+
return 'map';
|
|
28
|
+
if (schemaArrays.has(key) || schemaFields.has(key))
|
|
29
|
+
return 'schema';
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
if (key === 'schema' || key === 'itemSchema')
|
|
33
|
+
return 'schema';
|
|
34
|
+
if (key === 'schemas')
|
|
35
|
+
return 'map';
|
|
36
|
+
if (['example', 'examples', 'default', 'const', 'enum'].includes(key))
|
|
37
|
+
return undefined;
|
|
38
|
+
return 'document';
|
|
39
|
+
};
|
|
2
40
|
/**
|
|
3
41
|
* The workspace schema currently casts boolean JSON Schemas into empty objects.
|
|
4
42
|
* Restore them only in schema positions, never in example payloads or metadata.
|
|
5
43
|
* TODO: Remove this bridge when the shared schema accepts boolean JSON Schemas.
|
|
6
44
|
*/
|
|
7
|
-
export const restoreBooleanSchemas = (source, target) => {
|
|
45
|
+
export const restoreBooleanSchemas = (source, target, position = 'document') => {
|
|
8
46
|
const seen = new WeakSet();
|
|
9
|
-
const
|
|
10
|
-
const schemaArrays = new Set(['allOf', 'anyOf', 'oneOf', 'prefixItems']);
|
|
11
|
-
const schemaFields = new Set([
|
|
12
|
-
'items',
|
|
13
|
-
'not',
|
|
14
|
-
'additionalProperties',
|
|
15
|
-
'additionalItems',
|
|
16
|
-
'contains',
|
|
17
|
-
'propertyNames',
|
|
18
|
-
'if',
|
|
19
|
-
'then',
|
|
20
|
-
'else',
|
|
21
|
-
'unevaluatedProperties',
|
|
22
|
-
'unevaluatedItems',
|
|
23
|
-
'$ref-value',
|
|
24
|
-
]);
|
|
25
|
-
const getChildContext = (context, key) => {
|
|
26
|
-
if (context === 'map')
|
|
27
|
-
return 'schema';
|
|
28
|
-
if (context === 'schema') {
|
|
29
|
-
if (schemaMaps.has(key))
|
|
30
|
-
return 'map';
|
|
31
|
-
if (schemaArrays.has(key) || schemaFields.has(key))
|
|
32
|
-
return 'schema';
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
if (key === 'schema' || key === 'itemSchema')
|
|
36
|
-
return 'schema';
|
|
37
|
-
if (key === 'schemas')
|
|
38
|
-
return 'map';
|
|
39
|
-
if (['example', 'examples', 'default', 'const', 'enum'].includes(key))
|
|
40
|
-
return undefined;
|
|
41
|
-
return 'document';
|
|
42
|
-
};
|
|
43
|
-
const visit = (original, coerced, context = 'document') => {
|
|
47
|
+
const visit = (original, coerced, context) => {
|
|
44
48
|
if (context === 'schema' && typeof original === 'boolean')
|
|
45
49
|
return original;
|
|
46
50
|
if (!original || typeof original !== 'object' || !coerced || typeof coerced !== 'object' || seen.has(coerced))
|
|
@@ -61,7 +65,7 @@ export const restoreBooleanSchemas = (source, target) => {
|
|
|
61
65
|
const property = Object.getOwnPropertyDescriptor(coerced, key);
|
|
62
66
|
if (!property || !('value' in property))
|
|
63
67
|
continue;
|
|
64
|
-
const childContext =
|
|
68
|
+
const childContext = getChildPosition(context, key);
|
|
65
69
|
if (childContext === undefined)
|
|
66
70
|
continue;
|
|
67
71
|
Object.defineProperty(coerced, key, { ...property, value: visit(value, property.value, childContext) });
|
|
@@ -69,5 +73,5 @@ export const restoreBooleanSchemas = (source, target) => {
|
|
|
69
73
|
}
|
|
70
74
|
return coerced;
|
|
71
75
|
};
|
|
72
|
-
visit(source, target);
|
|
76
|
+
visit(source, target, position);
|
|
73
77
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { OperationMethod } from '@scalar/workspace-store/schemas/navigation';
|
|
2
2
|
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
|
|
3
3
|
/** Identify one operation by path and method, operation ID, or JSON pointer. */
|
|
4
4
|
export type OperationSelector = {
|
|
5
5
|
path: string;
|
|
6
|
-
method:
|
|
6
|
+
method: OperationMethod;
|
|
7
7
|
} | {
|
|
8
8
|
operationId: string;
|
|
9
9
|
} | {
|
|
@@ -19,7 +19,7 @@ type PageSelectors = {
|
|
|
19
19
|
model: string;
|
|
20
20
|
webhook: {
|
|
21
21
|
name: string;
|
|
22
|
-
method:
|
|
22
|
+
method: OperationMethod;
|
|
23
23
|
};
|
|
24
24
|
introduction: true;
|
|
25
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-document.d.ts","sourceRoot":"","sources":["../src/select-document.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select-document.d.ts","sourceRoot":"","sources":["../src/select-document.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAA;AACjF,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,8DAA8D,CAAA;AAEnH,gFAAgF;AAChF,MAAM,MAAM,iBAAiB,GACzB;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,eAAe,CAAA;CACxB,GACD;IACE,WAAW,EAAE,MAAM,CAAA;CACpB,GACD;IACE,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AACL,2EAA2E;AAC3E,MAAM,MAAM,oBAAoB,GAC5B;KACG,GAAG,IAAI,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,aAAa,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC;CACnH,CAAC,MAAM,aAAa,CAAC,GACtB,OAAO,CAAC,MAAM,CAAC,MAAM,aAAa,EAAE,KAAK,CAAC,CAAC,CAAA;AAE/C,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,iBAAiB,CAAA;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,eAAe,CAAA;KAAE,CAAA;IAClD,YAAY,EAAE,IAAI,CAAA;CACnB,CAAA;AAyKD,sEAAsE;AACtE,eAAO,MAAM,cAAc,GAAI,UAAU,eAAe,EAAE,UAAS,oBAAyB,KAAG,eAuN9F,CAAA"}
|