@mintlify/scraping 4.0.320 → 4.0.322
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/__test__/createOpenApiFrontmatter.test.ts +79 -0
- package/__test__/processOpenApiPath.test.ts +174 -0
- package/bin/openapi/common.d.ts +12 -4
- package/bin/openapi/common.js +59 -15
- package/bin/openapi/common.js.map +1 -1
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/openapi/common.ts +81 -17
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { createOpenApiFrontmatter } from '../src/openapi/common.js';
|
|
4
|
+
|
|
5
|
+
const { mockedOutputFile } = vi.hoisted(() => {
|
|
6
|
+
return { mockedOutputFile: vi.fn().mockResolvedValue(undefined) };
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
vi.mock('fs-extra', () => ({
|
|
10
|
+
outputFile: mockedOutputFile,
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
describe('createOpenApiFrontmatter', () => {
|
|
14
|
+
it('writes basic frontmatter with version and deprecated flags', async () => {
|
|
15
|
+
mockedOutputFile.mockClear();
|
|
16
|
+
const filename = 'test-basic.md';
|
|
17
|
+
|
|
18
|
+
await createOpenApiFrontmatter({
|
|
19
|
+
filename,
|
|
20
|
+
openApiMetaTag: 'foo',
|
|
21
|
+
version: '1.0.0',
|
|
22
|
+
deprecated: true,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const expected = `---\nopenapi: foo\nversion: 1.0.0\ndeprecated: true\n---`;
|
|
26
|
+
expect(mockedOutputFile).toHaveBeenCalledWith(filename, expected);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('prioritizes metadata fields and includes extra content', async () => {
|
|
30
|
+
mockedOutputFile.mockClear();
|
|
31
|
+
const filename = 'test-meta.md';
|
|
32
|
+
|
|
33
|
+
await createOpenApiFrontmatter({
|
|
34
|
+
filename,
|
|
35
|
+
openApiMetaTag: 'ABC',
|
|
36
|
+
version: '1.2.3',
|
|
37
|
+
deprecated: true,
|
|
38
|
+
metadata: {
|
|
39
|
+
version: '9.9.9',
|
|
40
|
+
deprecated: 'false',
|
|
41
|
+
title: 'My API',
|
|
42
|
+
extra: 'value',
|
|
43
|
+
},
|
|
44
|
+
extraContent: '# Hello',
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const expected =
|
|
48
|
+
`---\n` +
|
|
49
|
+
`openapi: ABC\n` +
|
|
50
|
+
`version: 9.9.9\n` +
|
|
51
|
+
`deprecated: false\n` +
|
|
52
|
+
`title: My API\n` +
|
|
53
|
+
`extra: value\n` +
|
|
54
|
+
`---\n\n` +
|
|
55
|
+
`# Hello`;
|
|
56
|
+
|
|
57
|
+
expect(mockedOutputFile).toHaveBeenCalledWith(filename, expected);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('ignores openapi key in metadata', async () => {
|
|
61
|
+
mockedOutputFile.mockClear();
|
|
62
|
+
const filename = 'test-ignore.md';
|
|
63
|
+
|
|
64
|
+
await createOpenApiFrontmatter({
|
|
65
|
+
filename,
|
|
66
|
+
openApiMetaTag: 'XYZ',
|
|
67
|
+
version: '0.0.1',
|
|
68
|
+
metadata: {
|
|
69
|
+
openapi: 'SHOULD_IGNORE',
|
|
70
|
+
version: '2.0.0',
|
|
71
|
+
foo: 'bar',
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const expected = `---\n` + `openapi: XYZ\n` + `version: 2.0.0\n` + `foo: bar\n` + `---`;
|
|
76
|
+
|
|
77
|
+
expect(mockedOutputFile).toHaveBeenCalledWith(filename, expected);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import type { DocumentV3 } from '@mintlify/common';
|
|
2
|
+
import type { DecoratedNavigationPage } from '@mintlify/models';
|
|
3
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
4
|
+
import { describe, it, expect } from 'vitest';
|
|
5
|
+
|
|
6
|
+
import { findNavGroup } from '../src/apiPages/common.js';
|
|
7
|
+
import { OpenApiExtensions, processOpenApiPath } from '../src/openapi/common.js';
|
|
8
|
+
import { simpleDoc } from './fixtures/openapi.js';
|
|
9
|
+
|
|
10
|
+
type OperationObject = OpenAPIV3.OperationObject<OpenApiExtensions>;
|
|
11
|
+
|
|
12
|
+
const createOperation = (overrides: Partial<OperationObject>) => {
|
|
13
|
+
return {
|
|
14
|
+
responses: {
|
|
15
|
+
200: {
|
|
16
|
+
description: 'OK',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
...overrides,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
describe('processOpenApiPath', () => {
|
|
24
|
+
const schema: DocumentV3 = simpleDoc;
|
|
25
|
+
const defaultOptions = {
|
|
26
|
+
writeFiles: false,
|
|
27
|
+
} as const;
|
|
28
|
+
|
|
29
|
+
it('should add a page and nav entry for a standard operation', () => {
|
|
30
|
+
const nav: DecoratedNavigationPage[] = [];
|
|
31
|
+
const decoratedNav: DecoratedNavigationPage[] = [];
|
|
32
|
+
const writePromises: Promise<void>[] = [];
|
|
33
|
+
const pagesAcc: Record<string, DecoratedNavigationPage> = {};
|
|
34
|
+
|
|
35
|
+
const pathItemObject = {
|
|
36
|
+
get: createOperation({ summary: 'List Pets', tags: ['Pets'] }),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
processOpenApiPath(
|
|
40
|
+
'/pets',
|
|
41
|
+
pathItemObject,
|
|
42
|
+
schema,
|
|
43
|
+
nav,
|
|
44
|
+
decoratedNav,
|
|
45
|
+
writePromises,
|
|
46
|
+
pagesAcc,
|
|
47
|
+
defaultOptions,
|
|
48
|
+
findNavGroup
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
expect(nav).toHaveLength(1);
|
|
52
|
+
expect(nav[0]).toHaveProperty('group', 'Pets');
|
|
53
|
+
expect(nav[0]).toHaveProperty('pages');
|
|
54
|
+
expect(nav[0]?.pages).toHaveLength(1);
|
|
55
|
+
|
|
56
|
+
expect(decoratedNav).toHaveLength(1);
|
|
57
|
+
expect(decoratedNav[0]?.pages).toHaveLength(1);
|
|
58
|
+
|
|
59
|
+
expect(Object.keys(pagesAcc)).toHaveLength(1);
|
|
60
|
+
|
|
61
|
+
expect(writePromises).toHaveLength(0);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should skip operations marked with x-excluded', () => {
|
|
65
|
+
const nav: DecoratedNavigationPage[] = [];
|
|
66
|
+
const decoratedNav: DecoratedNavigationPage[] = [];
|
|
67
|
+
const writePromises: Promise<void>[] = [];
|
|
68
|
+
const pagesAcc: Record<string, DecoratedNavigationPage> = {};
|
|
69
|
+
const operation: Partial<OperationObject> = {
|
|
70
|
+
summary: 'List Pets',
|
|
71
|
+
tags: ['Pets'],
|
|
72
|
+
'x-excluded': true,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const pathItemObject = {
|
|
76
|
+
get: createOperation(operation),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
processOpenApiPath(
|
|
80
|
+
'/pets',
|
|
81
|
+
pathItemObject,
|
|
82
|
+
schema,
|
|
83
|
+
nav,
|
|
84
|
+
decoratedNav,
|
|
85
|
+
writePromises,
|
|
86
|
+
pagesAcc,
|
|
87
|
+
defaultOptions,
|
|
88
|
+
findNavGroup
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
expect(nav).toHaveLength(0);
|
|
92
|
+
expect(Object.keys(pagesAcc)).toHaveLength(0);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('should use x-mint.metadata.title and description to override defaults', () => {
|
|
96
|
+
const nav: DecoratedNavigationPage[] = [];
|
|
97
|
+
const decoratedNav: DecoratedNavigationPage[] = [];
|
|
98
|
+
const writePromises: Promise<void>[] = [];
|
|
99
|
+
const pagesAcc: Record<string, DecoratedNavigationPage> = {};
|
|
100
|
+
const operation: Partial<OperationObject> = {
|
|
101
|
+
summary: 'List Pets',
|
|
102
|
+
tags: ['Pets'],
|
|
103
|
+
'x-mint': {
|
|
104
|
+
metadata: {
|
|
105
|
+
title: 'Custom Pet Title',
|
|
106
|
+
description: 'Custom description',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const pathItemObject = {
|
|
112
|
+
get: createOperation(operation),
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
processOpenApiPath(
|
|
116
|
+
'/pets',
|
|
117
|
+
pathItemObject,
|
|
118
|
+
schema,
|
|
119
|
+
nav,
|
|
120
|
+
decoratedNav,
|
|
121
|
+
writePromises,
|
|
122
|
+
pagesAcc,
|
|
123
|
+
defaultOptions,
|
|
124
|
+
findNavGroup
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
const page = (decoratedNav[0]?.pages as DecoratedNavigationPage[])[0];
|
|
128
|
+
expect(page?.title).toBe('Custom Pet Title');
|
|
129
|
+
expect(page?.description).toBe('Custom description');
|
|
130
|
+
|
|
131
|
+
const accPage = pagesAcc[Object.keys(pagesAcc)[0]!] as DecoratedNavigationPage;
|
|
132
|
+
expect(accPage.title).toBe('Custom Pet Title');
|
|
133
|
+
expect(accPage.description).toBe('Custom description');
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('should use x-mint.href to override the generated path', () => {
|
|
137
|
+
const nav: DecoratedNavigationPage[] = [];
|
|
138
|
+
const decoratedNav: DecoratedNavigationPage[] = [];
|
|
139
|
+
const writePromises: Promise<void>[] = [];
|
|
140
|
+
const pagesAcc: Record<string, DecoratedNavigationPage> = {};
|
|
141
|
+
|
|
142
|
+
const operation: Partial<OperationObject> = {
|
|
143
|
+
summary: 'List Pets',
|
|
144
|
+
tags: ['Pets'],
|
|
145
|
+
'x-mint': {
|
|
146
|
+
href: '/custom/list',
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const pathItemObject = {
|
|
151
|
+
get: createOperation(operation),
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
processOpenApiPath(
|
|
155
|
+
'/pets',
|
|
156
|
+
pathItemObject,
|
|
157
|
+
schema,
|
|
158
|
+
nav,
|
|
159
|
+
decoratedNav,
|
|
160
|
+
writePromises,
|
|
161
|
+
pagesAcc,
|
|
162
|
+
defaultOptions,
|
|
163
|
+
findNavGroup
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
expect(nav).toHaveLength(1);
|
|
167
|
+
expect(nav[0]?.pages).toHaveLength(1);
|
|
168
|
+
expect((nav[0]?.pages as DecoratedNavigationPage[])[0]).toBe('custom/list');
|
|
169
|
+
|
|
170
|
+
expect(decoratedNav).toHaveLength(1);
|
|
171
|
+
expect(decoratedNav[0]?.pages).toHaveLength(1);
|
|
172
|
+
expect((decoratedNav[0]?.pages as DecoratedNavigationPage[])[0]?.href).toBe('/custom/list');
|
|
173
|
+
});
|
|
174
|
+
});
|
package/bin/openapi/common.d.ts
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import type { DecoratedNavigationPage } from '@mintlify/models';
|
|
1
|
+
import type { DecoratedNavigationPage, PageMetaTags } from '@mintlify/models';
|
|
2
|
+
import { XMint } from '@mintlify/validation';
|
|
2
3
|
import { OpenAPI, OpenAPIV3 } from 'openapi-types';
|
|
4
|
+
export type OpenApiExtensions = {
|
|
5
|
+
'x-mint'?: XMint;
|
|
6
|
+
'x-excluded'?: boolean;
|
|
7
|
+
'x-hidden'?: boolean;
|
|
8
|
+
};
|
|
3
9
|
export declare const getOpenApiDefinition: (pathOrDocumentOrUrl: string | OpenAPI.Document | URL, localSchema?: boolean) => Promise<{
|
|
4
10
|
document: OpenAPI.Document;
|
|
5
11
|
isUrl: boolean;
|
|
6
12
|
}>;
|
|
7
|
-
export declare const createOpenApiFrontmatter: ({ filename, openApiMetaTag, version, deprecated, }: {
|
|
13
|
+
export declare const createOpenApiFrontmatter: ({ filename, openApiMetaTag, version, deprecated, metadata, extraContent, }: {
|
|
8
14
|
filename: string;
|
|
9
15
|
openApiMetaTag: string;
|
|
10
16
|
version?: string;
|
|
11
17
|
deprecated?: boolean;
|
|
18
|
+
metadata?: PageMetaTags;
|
|
19
|
+
extraContent?: string;
|
|
12
20
|
}) => Promise<void>;
|
|
13
21
|
export type GenerateOpenApiPagesOptions = {
|
|
14
22
|
openApiFilePath?: string;
|
|
@@ -26,5 +34,5 @@ export type OpenApiPageGenerationResult<N, DN> = {
|
|
|
26
34
|
pagesAcc: Record<string, DecoratedNavigationPage>;
|
|
27
35
|
isUrl: boolean;
|
|
28
36
|
};
|
|
29
|
-
export declare function processOpenApiPath<N, DN>(path: string, pathItemObject: OpenAPIV3.PathItemObject
|
|
30
|
-
export declare function processOpenApiWebhook<N, DN>(webhook: string, webhookObject: OpenAPIV3.PathItemObject
|
|
37
|
+
export declare function processOpenApiPath<N, DN>(path: string, pathItemObject: OpenAPIV3.PathItemObject<OpenApiExtensions>, schema: OpenAPI.Document, nav: N, decoratedNav: DN, writePromises: Promise<void>[], pagesAcc: Record<string, DecoratedNavigationPage>, options: GenerateOpenApiPagesOptions, findNavGroup: (nav: any, groupName?: string) => any): void;
|
|
38
|
+
export declare function processOpenApiWebhook<N, DN>(webhook: string, webhookObject: OpenAPIV3.PathItemObject<OpenApiExtensions>, _schema: OpenAPI.Document, nav: N, decoratedNav: DN, writePromises: Promise<void>[], pagesAcc: Record<string, DecoratedNavigationPage>, options: GenerateOpenApiPagesOptions, findNavGroup: (nav: any, groupName?: string) => any): void;
|
package/bin/openapi/common.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getOpenApiTitleAndDescription, optionallyAddLeadingSlash, slugToTitle, isAllowedLocalSchemaUrl, buildOpenApiMetaTag, } from '@mintlify/common';
|
|
1
|
+
import { getOpenApiTitleAndDescription, optionallyAddLeadingSlash, optionallyRemoveLeadingSlash, slugToTitle, isAllowedLocalSchemaUrl, buildOpenApiMetaTag, } from '@mintlify/common';
|
|
2
2
|
import { outputFile } from 'fs-extra';
|
|
3
3
|
import fse from 'fs-extra';
|
|
4
4
|
import fs from 'fs/promises';
|
|
@@ -34,10 +34,30 @@ export const getOpenApiDefinition = async (pathOrDocumentOrUrl, localSchema) =>
|
|
|
34
34
|
}
|
|
35
35
|
return { document: pathOrDocumentOrUrl, isUrl };
|
|
36
36
|
};
|
|
37
|
-
export const createOpenApiFrontmatter = async ({ filename, openApiMetaTag, version, deprecated, }) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
export const createOpenApiFrontmatter = async ({ filename, openApiMetaTag, version, deprecated, metadata, extraContent, }) => {
|
|
38
|
+
let frontmatter = `---\nopenapi: ${openApiMetaTag}`;
|
|
39
|
+
if (metadata && 'version' in metadata) {
|
|
40
|
+
frontmatter += `\nversion: ${metadata.version}`;
|
|
41
|
+
}
|
|
42
|
+
else if (version) {
|
|
43
|
+
frontmatter += `\nversion: ${version}`;
|
|
44
|
+
}
|
|
45
|
+
if (metadata && 'deprecated' in metadata) {
|
|
46
|
+
frontmatter += `\ndeprecated: ${metadata.deprecated}`;
|
|
47
|
+
}
|
|
48
|
+
else if (deprecated) {
|
|
49
|
+
frontmatter += `\ndeprecated: ${deprecated}`;
|
|
50
|
+
}
|
|
51
|
+
if (metadata) {
|
|
52
|
+
const reserved = new Set(['openapi', 'version', 'deprecated']);
|
|
53
|
+
Object.entries(metadata)
|
|
54
|
+
.filter(([k]) => !reserved.has(k))
|
|
55
|
+
.forEach(([key, value]) => {
|
|
56
|
+
frontmatter += `\n${key}: ${value}`;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
frontmatter += `\n---`;
|
|
60
|
+
const data = extraContent ? `${frontmatter}\n\n${extraContent}` : frontmatter;
|
|
41
61
|
await outputFile(filename, data);
|
|
42
62
|
};
|
|
43
63
|
const isHiddenOperation = (operation) => {
|
|
@@ -58,11 +78,21 @@ findNavGroup) {
|
|
|
58
78
|
if (isExcludedOperation(operation)) {
|
|
59
79
|
return;
|
|
60
80
|
}
|
|
81
|
+
const xMint = operation?.['x-mint'];
|
|
82
|
+
if (xMint?.href) {
|
|
83
|
+
xMint.href = optionallyAddLeadingSlash(xMint.href);
|
|
84
|
+
}
|
|
61
85
|
const groupName = operation?.tags?.[0];
|
|
62
|
-
|
|
86
|
+
let title = prepareStringToBeValidFilename(operation?.summary) ??
|
|
63
87
|
`${method}-${prepareStringToBeValidFilename(path)}`;
|
|
64
|
-
|
|
65
|
-
|
|
88
|
+
let folder = prepareStringToBeValidFilename(groupName) ?? '';
|
|
89
|
+
let base = join(options.outDir ?? '', folder, title);
|
|
90
|
+
if (xMint?.href) {
|
|
91
|
+
const slug = optionallyRemoveLeadingSlash(xMint.href);
|
|
92
|
+
title = parse(slug).name;
|
|
93
|
+
folder = parse(slug).dir;
|
|
94
|
+
base = join(folder, title);
|
|
95
|
+
}
|
|
66
96
|
const navGroup = findNavGroup(nav, groupName);
|
|
67
97
|
const decoratedNavGroup = findNavGroup(decoratedNav, groupName);
|
|
68
98
|
const filenameWithoutExtension = generateUniqueFilenameWithoutExtension(navGroup, base);
|
|
@@ -83,8 +113,8 @@ findNavGroup) {
|
|
|
83
113
|
const page = {
|
|
84
114
|
openapi: openapiMetaTag,
|
|
85
115
|
href: resolve('/', filenameWithoutExtension),
|
|
86
|
-
title: titleTag ?? slugToTitle(filenameWithoutExtension),
|
|
87
|
-
description,
|
|
116
|
+
title: xMint?.metadata?.title ?? titleTag ?? slugToTitle(filenameWithoutExtension),
|
|
117
|
+
description: xMint?.metadata?.description ?? description,
|
|
88
118
|
deprecated: operation?.deprecated,
|
|
89
119
|
version: options.version,
|
|
90
120
|
};
|
|
@@ -102,6 +132,8 @@ findNavGroup) {
|
|
|
102
132
|
openApiMetaTag: openapiMetaTag,
|
|
103
133
|
version: options.version,
|
|
104
134
|
deprecated: operation?.deprecated,
|
|
135
|
+
metadata: xMint?.metadata,
|
|
136
|
+
extraContent: xMint?.content,
|
|
105
137
|
}));
|
|
106
138
|
}
|
|
107
139
|
}
|
|
@@ -119,11 +151,21 @@ findNavGroup) {
|
|
|
119
151
|
if (isExcludedOperation(operation)) {
|
|
120
152
|
return;
|
|
121
153
|
}
|
|
154
|
+
const xMint = operation?.['x-mint'];
|
|
155
|
+
if (xMint?.href) {
|
|
156
|
+
xMint.href = optionallyAddLeadingSlash(xMint.href);
|
|
157
|
+
}
|
|
122
158
|
const groupName = operation?.tags?.[0];
|
|
123
|
-
|
|
159
|
+
let title = prepareStringToBeValidFilename(operation?.summary) ??
|
|
124
160
|
`${prepareStringToBeValidFilename(webhook)}`;
|
|
125
|
-
|
|
126
|
-
|
|
161
|
+
let folder = prepareStringToBeValidFilename(groupName) ?? '';
|
|
162
|
+
let base = join(options.outDir ?? '', folder, title);
|
|
163
|
+
if (xMint?.href) {
|
|
164
|
+
const slug = optionallyRemoveLeadingSlash(xMint.href);
|
|
165
|
+
title = parse(slug).name;
|
|
166
|
+
folder = parse(slug).dir;
|
|
167
|
+
base = join(folder, title);
|
|
168
|
+
}
|
|
127
169
|
const navGroup = findNavGroup(nav, groupName);
|
|
128
170
|
const decoratedNavGroup = findNavGroup(decoratedNav, groupName);
|
|
129
171
|
const filenameWithoutExtension = generateUniqueFilenameWithoutExtension(navGroup, base);
|
|
@@ -132,11 +174,11 @@ findNavGroup) {
|
|
|
132
174
|
method: 'webhook',
|
|
133
175
|
path: webhook,
|
|
134
176
|
});
|
|
135
|
-
const description = operation?.description;
|
|
177
|
+
const description = xMint?.metadata?.description ?? operation?.description;
|
|
136
178
|
const page = {
|
|
137
179
|
openapi: openapiMetaTag,
|
|
138
180
|
href: resolve('/', filenameWithoutExtension),
|
|
139
|
-
title: slugToTitle(filenameWithoutExtension),
|
|
181
|
+
title: xMint?.metadata?.title ?? slugToTitle(filenameWithoutExtension),
|
|
140
182
|
description,
|
|
141
183
|
version: options.version,
|
|
142
184
|
deprecated: operation?.deprecated,
|
|
@@ -155,6 +197,8 @@ findNavGroup) {
|
|
|
155
197
|
openApiMetaTag: openapiMetaTag,
|
|
156
198
|
version: options.version,
|
|
157
199
|
deprecated: operation?.deprecated,
|
|
200
|
+
metadata: xMint?.metadata,
|
|
201
|
+
extraContent: xMint?.content,
|
|
158
202
|
}));
|
|
159
203
|
}
|
|
160
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/openapi/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAE7B,yBAAyB,EACzB,WAAW,EACX,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/openapi/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAE7B,yBAAyB,EACzB,4BAA4B,EAC5B,WAAW,EACX,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAW,SAAS,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EACL,8BAA8B,EAC9B,sCAAsC,GACvC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAQnD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EACvC,mBAAoD,EACpD,WAAqB,EACoC,EAAE;IAC3D,IAAI,OAAO,mBAAmB,KAAK,QAAQ,EAAE,CAAC;QAC5C,IAAI,mBAAmB,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAA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