@stoplight/elements 9.0.12-beta-0.2 → 9.0.12-beta-0.4

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.
Files changed (68) hide show
  1. package/package.json +16 -76
  2. package/styles.min.css +1 -0
  3. package/web-components.min.js +2 -0
  4. package/web-components.min.js.LICENSE.txt +176 -0
  5. package/.DS_Store +0 -0
  6. package/.storybook/main.js +0 -6
  7. package/.storybook/manager.js +0 -1
  8. package/.storybook/preview.jsx +0 -3
  9. package/dist/LICENSE +0 -190
  10. package/dist/README.md +0 -19
  11. package/dist/package.json +0 -52
  12. package/jest.config.js +0 -7
  13. package/src/__fixtures__/api-descriptions/Instagram.ts +0 -1859
  14. package/src/__fixtures__/api-descriptions/badgesForSchema.ts +0 -36
  15. package/src/__fixtures__/api-descriptions/simpleApiWithInternalOperations.ts +0 -253
  16. package/src/__fixtures__/api-descriptions/simpleApiWithoutDescription.ts +0 -243
  17. package/src/__fixtures__/api-descriptions/todosApiBundled.ts +0 -430
  18. package/src/__fixtures__/api-descriptions/zoomApiYaml.ts +0 -6083
  19. package/src/components/API/APIWithResponsiveSidebarLayout.tsx +0 -125
  20. package/src/components/API/APIWithSidebarLayout.tsx +0 -158
  21. package/src/components/API/APIWithStackedLayout.tsx +0 -286
  22. package/src/components/API/__tests__/utils.test.ts +0 -1323
  23. package/src/components/API/utils.ts +0 -206
  24. package/src/containers/API.spec.tsx +0 -122
  25. package/src/containers/API.stories.tsx +0 -117
  26. package/src/containers/API.tsx +0 -277
  27. package/src/containers/story-helper.tsx +0 -53
  28. package/src/hooks/useExportDocumentProps.spec.tsx +0 -68
  29. package/src/hooks/useExportDocumentProps.tsx +0 -48
  30. package/src/index.ts +0 -6
  31. package/src/styles.css +0 -1
  32. package/src/utils/oas/__tests__/oas.spec.ts +0 -411
  33. package/src/utils/oas/index.ts +0 -192
  34. package/src/utils/oas/oas2.ts +0 -31
  35. package/src/utils/oas/oas3.ts +0 -54
  36. package/src/utils/oas/types.ts +0 -34
  37. package/src/web-components/__stories__/Api.stories.tsx +0 -63
  38. package/src/web-components/components.ts +0 -26
  39. package/src/web-components/index.ts +0 -3
  40. package/tsconfig.build.json +0 -18
  41. package/tsconfig.json +0 -7
  42. package/web-components.config.js +0 -1
  43. /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/Instagram.d.ts +0 -0
  44. /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/badgesForSchema.d.ts +0 -0
  45. /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/simpleApiWithInternalOperations.d.ts +0 -0
  46. /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/simpleApiWithoutDescription.d.ts +0 -0
  47. /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/todosApiBundled.d.ts +0 -0
  48. /package/{dist/__fixtures__ → __fixtures__}/api-descriptions/zoomApiYaml.d.ts +0 -0
  49. /package/{dist/components → components}/API/APIWithResponsiveSidebarLayout.d.ts +0 -0
  50. /package/{dist/components → components}/API/APIWithSidebarLayout.d.ts +0 -0
  51. /package/{dist/components → components}/API/APIWithStackedLayout.d.ts +0 -0
  52. /package/{dist/components → components}/API/utils.d.ts +0 -0
  53. /package/{dist/containers → containers}/API.d.ts +0 -0
  54. /package/{dist/containers → containers}/API.spec.d.ts +0 -0
  55. /package/{dist/containers → containers}/API.stories.d.ts +0 -0
  56. /package/{dist/containers → containers}/story-helper.d.ts +0 -0
  57. /package/{dist/hooks → hooks}/useExportDocumentProps.d.ts +0 -0
  58. /package/{dist/hooks → hooks}/useExportDocumentProps.spec.d.ts +0 -0
  59. /package/{dist/index.d.ts → index.d.ts} +0 -0
  60. /package/{dist/index.esm.js → index.esm.js} +0 -0
  61. /package/{dist/index.js → index.js} +0 -0
  62. /package/{dist/index.mjs → index.mjs} +0 -0
  63. /package/{dist/utils → utils}/oas/index.d.ts +0 -0
  64. /package/{dist/utils → utils}/oas/oas2.d.ts +0 -0
  65. /package/{dist/utils → utils}/oas/oas3.d.ts +0 -0
  66. /package/{dist/utils → utils}/oas/types.d.ts +0 -0
  67. /package/{dist/web-components → web-components}/components.d.ts +0 -0
  68. /package/{dist/web-components → web-components}/index.d.ts +0 -0
@@ -1,411 +0,0 @@
1
- import { transformOasToServiceNode } from '../';
2
-
3
- const oas3Document = {
4
- 'x-stoplight': { id: 'abc' },
5
- openapi: '3.0.0',
6
- info: {
7
- title: 'oas3',
8
- version: '1.0.0',
9
- },
10
- tags: [{ name: 'operation-tag' }, { name: 'model-tag' }],
11
- paths: {
12
- '/todos': {
13
- get: {
14
- summary: 'Get Todos',
15
- tags: ['operation-tag'],
16
- },
17
- },
18
- },
19
- components: {
20
- schemas: {
21
- Todo: {
22
- type: 'object',
23
- properties: {
24
- id: {
25
- type: 'integer',
26
- },
27
- },
28
- title: 'Todo',
29
- 'x-tags': ['model-tag'],
30
- },
31
- },
32
- },
33
- };
34
-
35
- const oas2Document = {
36
- 'x-stoplight': { id: 'abc' },
37
- swagger: '2.0.0',
38
- info: {
39
- title: 'oas2',
40
- version: '1.0.0',
41
- },
42
- tags: [{ name: 'operation-tag' }, { name: 'model-tag' }],
43
- paths: {
44
- '/todos': {
45
- get: {
46
- summary: 'Get Todos',
47
- tags: ['operation-tag'],
48
- },
49
- },
50
- },
51
- definitions: {
52
- Todo: {
53
- type: 'object',
54
- properties: {
55
- id: {
56
- type: 'integer',
57
- },
58
- },
59
- title: 'Todo',
60
- 'x-tags': ['model-tag'],
61
- },
62
- },
63
- };
64
-
65
- describe('computeOasNodes', () => {
66
- it('should return null for invalid document', () => {
67
- expect(transformOasToServiceNode({})).toBeNull();
68
- });
69
-
70
- it('should return oas nodes for oas3 document', () => {
71
- expect(transformOasToServiceNode(oas3Document)).toStrictEqual({
72
- type: 'http_service',
73
- uri: '/',
74
- name: 'oas3',
75
- data: {
76
- id: 'abc',
77
- version: '1.0.0',
78
- name: 'oas3',
79
- tags: [
80
- {
81
- id: '68c460dd9e97a',
82
- name: 'operation-tag',
83
- },
84
- {
85
- id: 'feec8b579ae6b',
86
- name: 'model-tag',
87
- },
88
- ],
89
- extensions: {
90
- 'x-stoplight': {
91
- id: 'abc',
92
- },
93
- },
94
- infoExtensions: {},
95
- },
96
- tags: ['operation-tag', 'model-tag'],
97
- children: [
98
- {
99
- type: 'http_operation',
100
- uri: '/paths/todos/get',
101
- data: {
102
- id: 'c35bc6b301d97',
103
- method: 'get',
104
- path: '/todos',
105
- summary: 'Get Todos',
106
- responses: [],
107
- servers: [],
108
- request: {
109
- headers: [],
110
- query: [],
111
- cookie: [],
112
- path: [],
113
- },
114
- tags: [
115
- {
116
- id: '68c460dd9e97a',
117
- name: 'operation-tag',
118
- },
119
- ],
120
- security: [],
121
- securityDeclarationType: 'inheritedFromService',
122
- extensions: {},
123
- },
124
- name: 'Get Todos',
125
- tags: ['operation-tag'],
126
- },
127
- {
128
- type: 'model',
129
- uri: '/schemas/Todo',
130
- data: {
131
- type: 'object',
132
- properties: {
133
- id: {
134
- type: 'integer',
135
- },
136
- },
137
- title: 'Todo',
138
- 'x-tags': ['model-tag'],
139
- },
140
- name: 'Todo',
141
- tags: ['model-tag'],
142
- },
143
- ],
144
- });
145
- });
146
-
147
- it('should return oas nodes for oas2 document', () => {
148
- expect(transformOasToServiceNode(oas2Document)).toStrictEqual({
149
- type: 'http_service',
150
- uri: '/',
151
- name: 'oas2',
152
- data: {
153
- id: 'abc',
154
- name: 'oas2',
155
- tags: [
156
- {
157
- id: '68c460dd9e97a',
158
- name: 'operation-tag',
159
- },
160
- {
161
- id: 'feec8b579ae6b',
162
- name: 'model-tag',
163
- },
164
- ],
165
- extensions: {
166
- 'x-stoplight': {
167
- id: 'abc',
168
- },
169
- },
170
- infoExtensions: {},
171
- version: '1.0.0',
172
- },
173
- tags: ['operation-tag', 'model-tag'],
174
- children: [
175
- {
176
- type: 'http_operation',
177
- uri: '/paths/todos/get',
178
- data: {
179
- id: 'c35bc6b301d97',
180
- method: 'get',
181
- path: '/todos',
182
- summary: 'Get Todos',
183
- responses: [],
184
- servers: [],
185
- request: {
186
- cookie: [],
187
- headers: [],
188
- path: [],
189
- query: [],
190
- },
191
- tags: [
192
- {
193
- id: '68c460dd9e97a',
194
- name: 'operation-tag',
195
- },
196
- ],
197
- security: [],
198
- securityDeclarationType: 'inheritedFromService',
199
- extensions: {},
200
- },
201
- name: 'Get Todos',
202
- tags: ['operation-tag'],
203
- },
204
- {
205
- type: 'model',
206
- uri: '/schemas/Todo',
207
- data: {
208
- type: 'object',
209
- properties: {
210
- id: {
211
- type: 'integer',
212
- },
213
- },
214
- title: 'Todo',
215
- 'x-tags': ['model-tag'],
216
- },
217
- name: 'Todo',
218
- tags: ['model-tag'],
219
- },
220
- ],
221
- });
222
- });
223
-
224
- it('should fallback to operationId', () => {
225
- expect(
226
- transformOasToServiceNode({
227
- 'x-stoplight': { id: 'def' },
228
- openapi: '3.0.0',
229
- info: {
230
- title: 'oas3',
231
- version: '1.0.0',
232
- },
233
- paths: {
234
- '/todos': {
235
- get: {
236
- operationId: 'get-todos',
237
- },
238
- },
239
- },
240
- }),
241
- ).toEqual({
242
- type: 'http_service',
243
- uri: '/',
244
- name: 'oas3',
245
- tags: [],
246
- data: {
247
- id: 'def',
248
- version: '1.0.0',
249
- name: 'oas3',
250
- extensions: {
251
- 'x-stoplight': {
252
- id: 'def',
253
- },
254
- },
255
- infoExtensions: {},
256
- },
257
- children: [
258
- {
259
- type: 'http_operation',
260
- uri: '/operations/get-todos',
261
- data: {
262
- id: 'a61f53c324669',
263
- iid: 'get-todos',
264
- method: 'get',
265
- path: '/todos',
266
- responses: [],
267
- servers: [],
268
- request: {
269
- headers: [],
270
- query: [],
271
- cookie: [],
272
- path: [],
273
- },
274
- tags: [],
275
- security: [],
276
- securityDeclarationType: 'inheritedFromService',
277
- extensions: {},
278
- },
279
- tags: [],
280
- name: 'get-todos',
281
- },
282
- ],
283
- });
284
- });
285
-
286
- it('should not throw error for non-common url paths', () => {
287
- expect(
288
- transformOasToServiceNode({
289
- 'x-stoplight': { id: 'def' },
290
- openapi: '3.0.0',
291
- info: {
292
- title: 'oas3',
293
- version: '1.0.0',
294
- },
295
- paths: {
296
- '/todos/{id}/flow)': {
297
- get: {
298
- operationId: 'get-todos',
299
- },
300
- },
301
- },
302
- }),
303
- ).toEqual({
304
- type: 'http_service',
305
- uri: '/',
306
- name: 'oas3',
307
- tags: [],
308
- data: {
309
- id: 'def',
310
- version: '1.0.0',
311
- name: 'oas3',
312
- extensions: {
313
- 'x-stoplight': {
314
- id: 'def',
315
- },
316
- },
317
- infoExtensions: {},
318
- },
319
- children: [
320
- {
321
- type: 'http_operation',
322
- uri: '/operations/get-todos',
323
- data: {
324
- id: '7b7e36ffa6501',
325
- iid: 'get-todos',
326
- method: 'get',
327
- path: '/todos/{id}/flow)',
328
- responses: [],
329
- servers: [],
330
- request: {
331
- headers: [],
332
- query: [],
333
- cookie: [],
334
- path: [],
335
- },
336
- tags: [],
337
-
338
- securityDeclarationType: 'inheritedFromService',
339
- security: [],
340
- extensions: {},
341
- },
342
- tags: [],
343
- name: 'get-todos',
344
- },
345
- ],
346
- });
347
- });
348
-
349
- it('should filter out unused security nodes and not show duplicate nodes', () => {
350
- const serviceNode = transformOasToServiceNode({
351
- openapi: '3.1.0',
352
- 'x-stoplight': {
353
- id: 'nso1sfqvio7bp',
354
- },
355
- info: {
356
- title: 'Test',
357
- version: '1.0',
358
- },
359
- servers: [
360
- {
361
- url: 'http://localhost:3000',
362
- },
363
- ],
364
- paths: {
365
- '/users': {
366
- get: {
367
- summary: 'Your GET endpoint',
368
- tags: [],
369
- responses: {},
370
- operationId: 'get-users',
371
- 'x-stoplight': {
372
- id: 'oblhqa66gbqqg',
373
- },
374
- security: [
375
- {
376
- API_Key_Query: [],
377
- },
378
- ],
379
- },
380
- },
381
- },
382
- components: {
383
- schemas: {},
384
- securitySchemes: {
385
- API_Key_Query: {
386
- name: 'API Key',
387
- type: 'apiKey',
388
- in: 'query',
389
- },
390
- API_Key_Header: {
391
- name: 'API Key',
392
- type: 'apiKey',
393
- in: 'header',
394
- },
395
- API_Key_Cookie: {
396
- name: 'API Key',
397
- type: 'apiKey',
398
- in: 'cookie',
399
- },
400
- },
401
- },
402
- security: [
403
- {
404
- API_Key_Query: [],
405
- },
406
- ],
407
- });
408
-
409
- expect(serviceNode?.data.security).toHaveLength(1);
410
- });
411
- });
@@ -1,192 +0,0 @@
1
- import { slugify } from '@stoplight/elements-core';
2
- import {
3
- Oas2HttpOperationTransformer,
4
- Oas2HttpServiceTransformer,
5
- Oas3HttpEndpointOperationTransformer,
6
- Oas3HttpServiceTransformer,
7
- OPERATION_CONFIG,
8
- WEBHOOK_CONFIG,
9
- } from '@stoplight/http-spec/oas';
10
- import { transformOas2Operation, transformOas2Service } from '@stoplight/http-spec/oas2';
11
- import { transformOas3Operation, transformOas3Service } from '@stoplight/http-spec/oas3';
12
- import { encodePointerFragment, pointerToPath } from '@stoplight/json';
13
- import { IHttpOperation, IHttpWebhookOperation, NodeType } from '@stoplight/types';
14
- import { get, isObject, last } from 'lodash';
15
- import { OpenAPIObject as _OpenAPIObject, PathObject } from 'openapi3-ts';
16
- import { Spec } from 'swagger-schema-official';
17
-
18
- import { oas2SourceMap } from './oas2';
19
- import { oas3SourceMap } from './oas3';
20
- import { ISourceNodeMap, NodeTypes, ServiceChildNode, ServiceNode } from './types';
21
-
22
- type OpenAPIObject = _OpenAPIObject & {
23
- webhooks?: PathObject;
24
- };
25
-
26
- type SpecDocument = Spec | OpenAPIObject;
27
-
28
- const isOas2 = (parsed: unknown): parsed is Spec =>
29
- isObject(parsed) &&
30
- 'swagger' in parsed &&
31
- Number.parseInt(String((parsed as Partial<{ swagger: unknown }>).swagger)) === 2;
32
-
33
- const isOas3 = (parsed: unknown): parsed is OpenAPIObject =>
34
- isObject(parsed) &&
35
- 'openapi' in parsed &&
36
- Number.parseFloat(String((parsed as Partial<{ openapi: unknown }>).openapi)) >= 3;
37
-
38
- const isOas31 = (parsed: unknown): parsed is OpenAPIObject =>
39
- isObject(parsed) &&
40
- 'openapi' in parsed &&
41
- Number.parseFloat(String((parsed as Partial<{ openapi: unknown }>).openapi)) === 3.1;
42
-
43
- const OAS_MODEL_REGEXP = /((definitions|components)\/?(schemas)?)\//;
44
-
45
- export function transformOasToServiceNode(apiDescriptionDocument: unknown) {
46
- if (isOas31(apiDescriptionDocument)) {
47
- return computeServiceNode(
48
- { ...apiDescriptionDocument, jsonSchemaDialect: 'http://json-schema.org/draft-07/schema#' },
49
- oas3SourceMap,
50
- transformOas3Service,
51
- transformOas3Operation,
52
- );
53
- }
54
- if (isOas3(apiDescriptionDocument)) {
55
- return computeServiceNode(apiDescriptionDocument, oas3SourceMap, transformOas3Service, transformOas3Operation);
56
- } else if (isOas2(apiDescriptionDocument)) {
57
- return computeServiceNode(apiDescriptionDocument, oas2SourceMap, transformOas2Service, transformOas2Operation);
58
- }
59
-
60
- return null;
61
- }
62
-
63
- function computeServiceNode(
64
- document: SpecDocument,
65
- map: ISourceNodeMap[],
66
- transformService: Oas2HttpServiceTransformer | Oas3HttpServiceTransformer,
67
- transformOperation: Oas2HttpOperationTransformer | Oas3HttpEndpointOperationTransformer,
68
- ) {
69
- const serviceDocument = transformService({ document });
70
- const serviceNode: ServiceNode = {
71
- type: NodeType.HttpService,
72
- uri: '/',
73
- name: serviceDocument.name,
74
- data: serviceDocument,
75
- tags: serviceDocument.tags?.map(tag => tag.name) || [],
76
- children: computeChildNodes(document, document, map, transformOperation),
77
- };
78
-
79
- return serviceNode;
80
- }
81
-
82
- function computeChildNodes(
83
- document: SpecDocument,
84
- data: SpecDocument,
85
- map: ISourceNodeMap[],
86
- transformer: Oas2HttpOperationTransformer | Oas3HttpEndpointOperationTransformer,
87
- parentUri: string = '',
88
- ) {
89
- const nodes: ServiceChildNode[] = [];
90
-
91
- if (!isObject(data)) return nodes;
92
-
93
- for (const [key, value] of Object.entries(data)) {
94
- const sanitizedKey = encodePointerFragment(key);
95
- const match = findMapMatch(sanitizedKey, map);
96
-
97
- if (match) {
98
- const uri = `${parentUri}/${sanitizedKey}`;
99
- const jsonPath = pointerToPath(`#${uri}`);
100
-
101
- if (match.type === NodeTypes.Operation && jsonPath.length === 3) {
102
- const path = String(jsonPath[1]);
103
- const method = String(jsonPath[2]);
104
- const operationDocument = transformer({
105
- document,
106
- name: path,
107
- method,
108
- config: OPERATION_CONFIG,
109
- }) as IHttpOperation;
110
- let parsedUri;
111
- const encodedPath = String(encodePointerFragment(path));
112
-
113
- if (operationDocument.iid) {
114
- parsedUri = `/operations/${operationDocument.iid}`;
115
- } else {
116
- parsedUri = uri.replace(encodedPath, slugify(path));
117
- }
118
-
119
- nodes.push({
120
- type: NodeType.HttpOperation,
121
- uri: parsedUri,
122
- data: operationDocument,
123
- name: operationDocument.summary || operationDocument.iid || operationDocument.path,
124
- tags: operationDocument.tags?.map(tag => tag.name) || [],
125
- });
126
- } else if (match.type === NodeTypes.Webhook && jsonPath.length === 3) {
127
- const name = String(jsonPath[1]);
128
- const method = String(jsonPath[2]);
129
- const webhookDocument = transformer({
130
- document,
131
- name,
132
- method,
133
- config: WEBHOOK_CONFIG,
134
- }) as IHttpWebhookOperation;
135
-
136
- let parsedUri;
137
- const encodedPath = String(encodePointerFragment(name));
138
-
139
- if (webhookDocument.iid) {
140
- parsedUri = `/webhooks/${webhookDocument.iid}`;
141
- } else {
142
- parsedUri = uri.replace(encodedPath, slugify(name));
143
- }
144
-
145
- nodes.push({
146
- type: NodeType.HttpWebhook,
147
- uri: parsedUri,
148
- data: webhookDocument,
149
- name: webhookDocument.summary || webhookDocument.name,
150
- tags: webhookDocument.tags?.map(tag => tag.name) || [],
151
- });
152
- } else if (match.type === NodeTypes.Model) {
153
- const schemaDocument = get(document, jsonPath);
154
- const parsedUri = uri.replace(OAS_MODEL_REGEXP, 'schemas/');
155
-
156
- nodes.push({
157
- type: NodeType.Model,
158
- uri: parsedUri,
159
- data: schemaDocument,
160
- name: schemaDocument.title || last(uri.split('/')) || '',
161
- tags: schemaDocument['x-tags'] || [],
162
- });
163
- }
164
-
165
- if (match.children) {
166
- nodes.push(...computeChildNodes(document, value, match.children, transformer, uri));
167
- }
168
- }
169
- }
170
-
171
- return nodes;
172
- }
173
-
174
- function findMapMatch(key: string | number, map: ISourceNodeMap[]): ISourceNodeMap | void {
175
- if (typeof key === 'number') return;
176
- for (const entry of map) {
177
- const escapedKey = key.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
178
-
179
- if (!!entry.match?.match(escapedKey) || (entry.notMatch !== void 0 && !entry.notMatch.match(escapedKey))) {
180
- return entry;
181
- }
182
- }
183
- }
184
-
185
- export function isJson(value: string) {
186
- try {
187
- JSON.parse(value);
188
- } catch (e) {
189
- return false;
190
- }
191
- return true;
192
- }
@@ -1,31 +0,0 @@
1
- import { ISourceNodeMap, NodeTypes } from './types';
2
-
3
- export const oas2SourceMap: ISourceNodeMap[] = [
4
- {
5
- match: 'paths',
6
- type: NodeTypes.Paths,
7
- children: [
8
- {
9
- notMatch: '^x-',
10
- type: NodeTypes.Path,
11
- children: [
12
- {
13
- match: 'get|post|put|delete|options|head|patch|trace',
14
- type: NodeTypes.Operation,
15
- },
16
- ],
17
- },
18
- ],
19
- },
20
-
21
- {
22
- match: 'definitions',
23
- type: NodeTypes.Models,
24
- children: [
25
- {
26
- notMatch: '^x-',
27
- type: NodeTypes.Model,
28
- },
29
- ],
30
- },
31
- ];
@@ -1,54 +0,0 @@
1
- import { ISourceNodeMap, NodeTypes } from './types';
2
-
3
- export const oas3SourceMap: ISourceNodeMap[] = [
4
- {
5
- match: 'paths',
6
- type: NodeTypes.Paths,
7
- children: [
8
- {
9
- notMatch: '^x-',
10
- type: NodeTypes.Path,
11
- children: [
12
- {
13
- match: 'get|post|put|delete|options|head|patch|trace',
14
- type: NodeTypes.Operation,
15
- },
16
- ],
17
- },
18
- ],
19
- },
20
-
21
- {
22
- match: 'webhooks',
23
- type: NodeTypes.Webhooks,
24
- children: [
25
- {
26
- notMatch: '^x-',
27
- type: NodeTypes.Webhook,
28
- children: [
29
- {
30
- match: 'get|post|put|delete|options|head|patch|trace',
31
- type: NodeTypes.Webhook,
32
- },
33
- ],
34
- },
35
- ],
36
- },
37
-
38
- {
39
- match: 'components',
40
- type: NodeTypes.Components,
41
- children: [
42
- {
43
- match: 'schemas',
44
- type: NodeTypes.Models,
45
- children: [
46
- {
47
- notMatch: '^x-',
48
- type: NodeTypes.Model,
49
- },
50
- ],
51
- },
52
- ],
53
- },
54
- ];