@redocly/openapi-core 1.0.0-beta.62 → 1.0.0-beta.66

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 (76) hide show
  1. package/__tests__/lint.test.ts +17 -0
  2. package/__tests__/resolve.test.ts +10 -2
  3. package/__tests__/utils.ts +3 -5
  4. package/lib/benchmark/utils.js +2 -2
  5. package/lib/config/all.js +8 -1
  6. package/lib/config/config.d.ts +1 -0
  7. package/lib/config/config.js +4 -4
  8. package/lib/index.d.ts +2 -1
  9. package/lib/index.js +5 -1
  10. package/lib/js-yaml/index.d.ts +3 -0
  11. package/lib/js-yaml/index.js +19 -0
  12. package/lib/oas-types.js +3 -0
  13. package/lib/resolve.d.ts +1 -1
  14. package/lib/resolve.js +3 -4
  15. package/lib/rules/builtin.d.ts +6 -0
  16. package/lib/rules/common/info-description-override.d.ts +2 -0
  17. package/lib/rules/common/info-description-override.js +24 -0
  18. package/lib/rules/common/info-license-url.js +1 -0
  19. package/lib/rules/common/no-http-verbs-in-paths.d.ts +2 -0
  20. package/lib/rules/common/no-http-verbs-in-paths.js +33 -0
  21. package/lib/rules/common/operation-description-override.d.ts +2 -0
  22. package/lib/rules/common/operation-description-override.js +29 -0
  23. package/lib/rules/common/path-excludes-patterns.d.ts +2 -0
  24. package/lib/rules/common/path-excludes-patterns.js +22 -0
  25. package/lib/rules/common/path-segment-plural.d.ts +2 -0
  26. package/lib/rules/common/path-segment-plural.js +32 -0
  27. package/lib/rules/common/tag-description-override.d.ts +2 -0
  28. package/lib/rules/common/tag-description-override.js +25 -0
  29. package/lib/rules/oas2/index.d.ts +8 -0
  30. package/lib/rules/oas2/index.js +16 -0
  31. package/lib/rules/oas2/request-mime-type.d.ts +2 -0
  32. package/lib/rules/oas2/request-mime-type.js +17 -0
  33. package/lib/rules/oas2/response-mime-type.d.ts +2 -0
  34. package/lib/rules/oas2/response-mime-type.js +17 -0
  35. package/lib/rules/oas3/index.d.ts +3 -0
  36. package/lib/rules/oas3/index.js +17 -1
  37. package/lib/rules/oas3/request-mime-type.d.ts +2 -0
  38. package/lib/rules/oas3/request-mime-type.js +31 -0
  39. package/lib/rules/oas3/response-mime-type.d.ts +2 -0
  40. package/lib/rules/oas3/response-mime-type.js +31 -0
  41. package/lib/types/oas3_1.js +6 -0
  42. package/lib/types/redocly-yaml.js +332 -21
  43. package/lib/utils.d.ts +15 -1
  44. package/lib/utils.js +82 -3
  45. package/package.json +6 -4
  46. package/src/__tests__/js-yaml.test.ts +47 -0
  47. package/src/__tests__/lint.test.ts +13 -0
  48. package/src/__tests__/utils.test.ts +74 -0
  49. package/src/benchmark/utils.ts +2 -2
  50. package/src/config/all.ts +8 -1
  51. package/src/config/config.ts +6 -5
  52. package/src/index.ts +3 -1
  53. package/src/js-yaml/index.ts +19 -0
  54. package/src/oas-types.ts +4 -0
  55. package/src/resolve.ts +5 -5
  56. package/src/rules/__tests__/no-unresolved-refs.test.ts +2 -2
  57. package/src/rules/common/__tests__/info-license.test.ts +1 -1
  58. package/src/rules/common/info-description-override.ts +24 -0
  59. package/src/rules/common/info-license-url.ts +1 -0
  60. package/src/rules/common/no-http-verbs-in-paths.ts +36 -0
  61. package/src/rules/common/operation-description-override.ts +30 -0
  62. package/src/rules/common/path-excludes-patterns.ts +23 -0
  63. package/src/rules/common/path-segment-plural.ts +31 -0
  64. package/src/rules/common/tag-description-override.ts +25 -0
  65. package/src/rules/oas2/index.ts +16 -0
  66. package/src/rules/oas2/request-mime-type.ts +17 -0
  67. package/src/rules/oas2/response-mime-type.ts +17 -0
  68. package/src/rules/oas3/index.ts +18 -3
  69. package/src/rules/oas3/request-mime-type.ts +31 -0
  70. package/src/rules/oas3/response-mime-type.ts +31 -0
  71. package/src/rules/utils.ts +1 -1
  72. package/src/types/oas3_1.ts +7 -0
  73. package/src/types/redocly-yaml.ts +434 -22
  74. package/src/typings/swagger.ts +0 -1
  75. package/src/utils.ts +101 -2
  76. package/tsconfig.tsbuildinfo +1 -1
@@ -1,4 +1,5 @@
1
1
  import { Oas3RuleSet } from '../../oas-types';
2
+ import { Oas3Decorator } from '../../visitors';
2
3
  import { OasSpec } from '../common/spec';
3
4
  import { Operation2xxResponse } from '../common/operation-2xx-response';
4
5
  import { OperationIdUnique } from '../common/operation-operationId-unique';
@@ -37,8 +38,14 @@ import { OperationOperationId } from '../common/operation-operationId';
37
38
  import { OperationSummary } from '../common/operation-summary';
38
39
  import { NoAmbiguousPaths } from '../common/no-ambiguous-paths';
39
40
  import { NoEmptyEnumServers } from './no-servers-empty-enum';
40
-
41
- import { Oas3Decorator } from '../../visitors';
41
+ import { NoHttpVerbsInPaths } from '../common/no-http-verbs-in-paths';
42
+ import { RequestMimeType } from './request-mime-type';
43
+ import { ResponseMimeType } from './response-mime-type';
44
+ import { PathSegmentPlural } from '../common/path-segment-plural';
45
+ import { OperationDescriptionOverride } from '../common/operation-description-override';
46
+ import { TagDescriptionOverride } from '../common/tag-description-override';
47
+ import { InfoDescriptionOverride } from '../common/info-description-override';
48
+ import { PathExcludesPatterns } from '../common/path-excludes-patterns';
42
49
 
43
50
  export const rules = {
44
51
  spec: OasSpec,
@@ -78,11 +85,19 @@ export const rules = {
78
85
  'no-identical-paths': NoIdenticalPaths,
79
86
  'no-ambiguous-paths': NoAmbiguousPaths,
80
87
  'no-undefined-server-variable': NoUndefinedServerVariable,
81
- 'no-servers-empty-enum': NoEmptyEnumServers
88
+ 'no-servers-empty-enum': NoEmptyEnumServers,
89
+ 'no-http-verbs-in-paths': NoHttpVerbsInPaths,
90
+ 'path-excludes-patterns': PathExcludesPatterns,
91
+ 'request-mime-type': RequestMimeType,
92
+ 'response-mime-type': ResponseMimeType,
93
+ 'path-segment-plural': PathSegmentPlural,
82
94
  } as Oas3RuleSet;
83
95
 
84
96
  export const preprocessors = {};
85
97
 
86
98
  export const decorators = {
87
99
  'registry-dependencies': RegistryDependencies as Oas3Decorator,
100
+ 'operation-description-override': OperationDescriptionOverride as Oas3Decorator,
101
+ 'tag-description-override': TagDescriptionOverride as Oas3Decorator,
102
+ 'info-description-override': InfoDescriptionOverride as Oas3Decorator,
88
103
  };
@@ -0,0 +1,31 @@
1
+ import { Oas3Rule } from '../../visitors';
2
+ import { UserContext } from '../../walk';
3
+ import { Oas3RequestBody, Oas3Response } from '../../typings/openapi';
4
+ import { validateMimeTypeOAS3 } from '../../utils';
5
+
6
+ export const RequestMimeType: Oas3Rule = ({ allowedValues }) => {
7
+ return {
8
+ PathMap: {
9
+ RequestBody: {
10
+ leave(requestBody: Oas3RequestBody, ctx: UserContext) {
11
+ validateMimeTypeOAS3({ type: 'consumes', value: requestBody }, ctx, allowedValues);
12
+ },
13
+ },
14
+ Callback: {
15
+ RequestBody() {},
16
+ Response: {
17
+ leave(response: Oas3Response, ctx: UserContext) {
18
+ validateMimeTypeOAS3({ type: 'consumes', value: response }, ctx, allowedValues);
19
+ },
20
+ },
21
+ },
22
+ },
23
+ WebhooksMap: {
24
+ Response: {
25
+ leave(response: Oas3Response, ctx: UserContext) {
26
+ validateMimeTypeOAS3({ type: 'consumes', value: response }, ctx, allowedValues);
27
+ },
28
+ },
29
+ },
30
+ };
31
+ };
@@ -0,0 +1,31 @@
1
+ import { Oas3Rule } from '../../visitors';
2
+ import { UserContext } from '../../walk';
3
+ import { Oas3RequestBody, Oas3Response } from '../../typings/openapi';
4
+ import { validateMimeTypeOAS3 } from '../../utils';
5
+
6
+ export const ResponseMimeType: Oas3Rule = ({ allowedValues }) => {
7
+ return {
8
+ PathMap: {
9
+ Response: {
10
+ leave(response: Oas3Response, ctx: UserContext) {
11
+ validateMimeTypeOAS3({ type: 'produces', value: response }, ctx, allowedValues);
12
+ },
13
+ },
14
+ Callback: {
15
+ Response() {},
16
+ RequestBody: {
17
+ leave(requestBody: Oas3RequestBody, ctx: UserContext) {
18
+ validateMimeTypeOAS3({ type: 'produces', value: requestBody }, ctx, allowedValues);
19
+ },
20
+ },
21
+ },
22
+ },
23
+ WebhooksMap: {
24
+ RequestBody: {
25
+ leave(requestBody: Oas3RequestBody, ctx: UserContext) {
26
+ validateMimeTypeOAS3({ type: 'produces', value: requestBody }, ctx, allowedValues);
27
+ },
28
+ },
29
+ },
30
+ };
31
+ };
@@ -79,4 +79,4 @@ export function getSuggest(given: string, variants: string[]): string[] {
79
79
 
80
80
  // if (bestMatch.distance <= 4) return bestMatch.string;
81
81
  return distances.map((d) => d.variant);
82
- }
82
+ }
@@ -97,6 +97,13 @@ const Operation: NodeType = {
97
97
 
98
98
  const Schema: NodeType = {
99
99
  properties: {
100
+ $id: { type: 'string' },
101
+ id: { type: 'string' },
102
+ $schema: { type: 'string' },
103
+ definitions: 'NamedSchemas',
104
+ $defs: 'NamedSchemas',
105
+ $vocabulary: { type: 'string' },
106
+
100
107
  externalDocs: 'ExternalDocs',
101
108
  discriminator: 'Discriminator',
102
109
  myArbitraryKeyword: { type: 'boolean' },
@@ -1,11 +1,12 @@
1
1
  import { NodeType, listOf } from '.';
2
+ import { omitObjectProps, pickObjectProps } from '../utils';
2
3
 
3
4
  const ConfigRoot: NodeType = {
4
5
  properties: {
5
6
  apiDefinitions: {
6
7
  type: 'object',
7
8
  properties: {},
8
- additionalProperties: { properties: { type: 'string' } }
9
+ additionalProperties: { properties: { type: 'string' } },
9
10
  },
10
11
  lint: 'ConfigLint',
11
12
  referenceDocs: 'ConfigReferenceDocs',
@@ -91,25 +92,398 @@ const ConfigSidebarLinks: NodeType = {
91
92
  },
92
93
  };
93
94
 
95
+ const CommonThemeColors: NodeType = {
96
+ properties: {
97
+ main: { type: 'string' },
98
+ light: { type: 'string' },
99
+ dark: { type: 'string' },
100
+ contrastText: { type: 'string' },
101
+ },
102
+ };
103
+
104
+ const CommonColorProps: NodeType = {
105
+ properties: {
106
+ backgroundColor: { type: 'string' },
107
+ borderColor: { type: 'string' },
108
+ color: { type: 'string' },
109
+ tabTextColor: { type: 'string' },
110
+ },
111
+ };
112
+
113
+ const BorderThemeColors: NodeType = {
114
+ properties: pickObjectProps(CommonThemeColors.properties, ['light', 'dark']),
115
+ };
116
+
117
+ const HttpColors: NodeType = {
118
+ properties: {
119
+ basic: { type: 'string' },
120
+ delete: { type: 'string' },
121
+ get: { type: 'string' },
122
+ head: { type: 'string' },
123
+ link: { type: 'string' },
124
+ options: { type: 'string' },
125
+ patch: { type: 'string' },
126
+ post: { type: 'string' },
127
+ put: { type: 'string' },
128
+ },
129
+ };
130
+
131
+ const ResponseColors: NodeType = {
132
+ properties: {
133
+ errors: 'CommonColorProps',
134
+ info: 'CommonColorProps',
135
+ redirect: 'CommonColorProps',
136
+ success: 'CommonColorProps',
137
+ },
138
+ };
139
+
140
+ const SecondaryColors: NodeType = {
141
+ properties: omitObjectProps(CommonThemeColors.properties, ['dark']),
142
+ };
143
+
144
+ const TextThemeColors: NodeType = {
145
+ properties: {
146
+ primary: { type: 'string' },
147
+ secondary: { type: 'string' },
148
+ light: { type: 'string' },
149
+ },
150
+ };
151
+
152
+ const ThemeColors: NodeType = {
153
+ properties: {
154
+ accent: 'CommonThemeColors',
155
+ border: 'BorderThemeColors',
156
+ error: 'CommonThemeColors',
157
+ http: 'HttpColors',
158
+ primary: 'CommonThemeColors',
159
+ responses: 'ResponseColors',
160
+ secondary: 'SecondaryColors',
161
+ success: 'CommonThemeColors',
162
+ text: 'TextThemeColors',
163
+ tonalOffset: { type: 'number' },
164
+ warning: 'CommonThemeColors',
165
+ },
166
+ };
167
+
168
+ const SizeProps: NodeType = {
169
+ properties: {
170
+ fontSize: { type: 'string' },
171
+ padding: { type: 'string' },
172
+ minWidth: { type: 'string' },
173
+ },
174
+ };
175
+
176
+ const Sizes: NodeType = {
177
+ properties: {
178
+ small: 'SizeProps',
179
+ medium: 'SizeProps',
180
+ large: 'SizeProps',
181
+ xlarge: 'SizeProps',
182
+ },
183
+ };
184
+
185
+ const FontConfig: NodeType = {
186
+ properties: {
187
+ fontFamily: { type: 'string' },
188
+ fontSize: { type: 'string' },
189
+ fontWeight: { type: 'string' },
190
+ lineHeight: { type: 'string' },
191
+ },
192
+ };
193
+
194
+ const ButtonsConfig: NodeType = {
195
+ properties: {
196
+ ...omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
197
+ borderRadius: { type: 'string' },
198
+ hoverStyle: { type: 'string' },
199
+ boxShadow: { type: 'string' },
200
+ hoverBoxShadow: { type: 'string' },
201
+ sizes: 'Sizes',
202
+ },
203
+ };
204
+
205
+ const BadgeFontConfig: NodeType = {
206
+ properties: pickObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
207
+ };
208
+
209
+ const BadgeSizes: NodeType = {
210
+ properties: {
211
+ medium: 'BadgeFontConfig',
212
+ small: 'BadgeFontConfig',
213
+ },
214
+ };
215
+
216
+ const HttpBadgesConfig: NodeType = {
217
+ properties: {
218
+ ...omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
219
+ borderRadius: { type: 'string' },
220
+ color: { type: 'string' },
221
+ sizes: 'BadgeSizes',
222
+ },
223
+ };
224
+
225
+ const LabelControls: NodeType = {
226
+ properties: {
227
+ top: { type: 'string' },
228
+ },
229
+ };
230
+
231
+ const Panels: NodeType = {
232
+ properties: {
233
+ borderRadius: { type: 'string' },
234
+ },
235
+ };
236
+
237
+ const TryItButton: NodeType = {
238
+ properties: {
239
+ fullWidth: { type: 'boolean' },
240
+ },
241
+ };
242
+
243
+ const Components: NodeType = {
244
+ properties: {
245
+ buttons: 'ButtonsConfig',
246
+ httpBadges: 'HttpBadgesConfig',
247
+ layoutControls: 'LabelControls',
248
+ panels: 'Panels',
249
+ tryItButton: 'TryItButton',
250
+ tryItSendButton: 'TryItButton',
251
+ },
252
+ };
253
+
254
+ const Breakpoints: NodeType = {
255
+ properties: {
256
+ small: { type: 'string' },
257
+ medium: { type: 'string' },
258
+ large: { type: 'string' },
259
+ },
260
+ };
261
+
262
+ const StackedConfig: NodeType = {
263
+ properties: {
264
+ maxWidth: 'Breakpoints',
265
+ },
266
+ };
267
+
268
+ const ThreePanelConfig: NodeType = {
269
+ properties: {
270
+ maxWidth: 'Breakpoints',
271
+ },
272
+ };
273
+
274
+ const Layout: NodeType = {
275
+ properties: {
276
+ showDarkRightPanel: { type: 'boolean' },
277
+ stacked: 'StackedConfig',
278
+ 'three-panel': 'ThreePanelConfig',
279
+ },
280
+ };
281
+
282
+ const SchemaColorsConfig: NodeType = {
283
+ properties: {
284
+ backgroundColor: { type: 'string' },
285
+ border: { type: 'string' },
286
+ },
287
+ };
288
+
289
+ const Schema: NodeType = {
290
+ properties: {
291
+ breakFieldNames: { type: 'boolean' },
292
+ caretColor: { type: 'string' },
293
+ caretSize: { type: 'string' },
294
+ constraints: 'SchemaColorsConfig',
295
+ defaultDetailsWidth: { type: 'string' },
296
+ examples: 'SchemaColorsConfig',
297
+ labelsTextSize: { type: 'string' },
298
+ linesColor: { type: 'string' },
299
+ nestedBackground: { type: 'string' },
300
+ nestingSpacing: { type: 'string' },
301
+ requireLabelColor: { type: 'string' },
302
+ typeNameColor: { type: 'string' },
303
+ typeTitleColor: { type: 'string' },
304
+ },
305
+ };
306
+
307
+ const GroupItemsConfig: NodeType = {
308
+ properties: {
309
+ subItemsColor: { type: 'string' },
310
+ textTransform: { type: 'string' },
311
+ fontWeight: { type: 'string' },
312
+ },
313
+ };
314
+
315
+ const Level1Items: NodeType = {
316
+ properties: pickObjectProps(GroupItemsConfig.properties, ['textTransform']),
317
+ };
318
+
319
+ const SpacingConfig: NodeType = {
320
+ properties: {
321
+ unit: { type: 'number' },
322
+ paddingHorizontal: { type: 'string' },
323
+ paddingVertical: { type: 'string' },
324
+ offsetTop: { type: 'string' },
325
+ offsetLeft: { type: 'string' },
326
+ offsetNesting: { type: 'string' },
327
+ },
328
+ };
329
+
330
+ const Sidebar: NodeType = {
331
+ properties: {
332
+ ...omitObjectProps(FontConfig.properties, ['fontWeight', 'lineHeight']),
333
+ activeBgColor: { type: 'string' },
334
+ activeTextColor: { type: 'string' },
335
+ backgroundColor: { type: 'string' },
336
+ borderRadius: { type: 'string' },
337
+ breakPath: { type: 'boolean' },
338
+ caretColor: { type: 'string' },
339
+ caretSize: { type: 'string' },
340
+ groupItems: 'GroupItemsConfig',
341
+ level1items: 'Level1Items',
342
+ rightLineColor: { type: 'string' },
343
+ separatorLabelColor: { type: 'string' },
344
+ showAtBreakpoint: { type: 'string' },
345
+ spacing: 'SpacingConfig',
346
+ textColor: { type: 'string' },
347
+ width: { type: 'string' },
348
+ },
349
+ };
350
+
351
+ const Heading: NodeType = {
352
+ properties: {
353
+ ...FontConfig.properties,
354
+ color: { type: 'string' },
355
+ transform: { type: 'string' },
356
+ },
357
+ };
358
+
359
+ const CodeConfig: NodeType = {
360
+ properties: {
361
+ ...FontConfig.properties,
362
+ backgroundColor: { type: 'string' },
363
+ color: { type: 'string' },
364
+ wordBreak: { type: 'string' },
365
+ wrap: { type: 'boolean' },
366
+ },
367
+ };
368
+
369
+ const HeadingsConfig: NodeType = {
370
+ properties: omitObjectProps(FontConfig.properties, ['fontSize']),
371
+ };
372
+
373
+ const LinksConfig: NodeType = {
374
+ properties: {
375
+ color: { type: 'string' },
376
+ hover: { type: 'string' },
377
+ textDecoration: { type: 'string' },
378
+ visited: { type: 'string' },
379
+ },
380
+ };
381
+
382
+ const Typography: NodeType = {
383
+ properties: {
384
+ code: 'CodeConfig',
385
+ fieldName: 'FontConfig',
386
+ ...pickObjectProps(FontConfig.properties, ['fontSize', 'fontFamily']),
387
+ fontWeightBold: { type: 'string' },
388
+ fontWeightLight: { type: 'string' },
389
+ fontWeightRegular: { type: 'string' },
390
+ heading1: 'Heading',
391
+ heading2: 'Heading',
392
+ heading3: 'Heading',
393
+ headings: 'HeadingsConfig',
394
+ lineHeight: { type: 'string' },
395
+ links: 'LinksConfig',
396
+ optimizeSpeed: { type: 'boolean' },
397
+ rightPanelHeading: 'Heading',
398
+ smoothing: { type: 'string' },
399
+ },
400
+ };
401
+
402
+ const TokenProps: NodeType = {
403
+ properties: {
404
+ color: { type: 'string' },
405
+ ...omitObjectProps(FontConfig.properties, ['fontWeight']),
406
+ },
407
+ };
408
+
409
+ const CodeBlock: NodeType = {
410
+ properties: {
411
+ backgroundColor: { type: 'string' },
412
+ borderRadius: { type: 'string' },
413
+ tokens: 'TokenProps',
414
+ },
415
+ };
416
+
417
+ const Logo: NodeType = {
418
+ properties: {
419
+ gutter: { type: 'string' },
420
+ maxHeight: { type: 'string' },
421
+ maxWidth: { type: 'string' },
422
+ },
423
+ };
424
+
425
+ const ButtonOverrides: NodeType = {
426
+ properties: {
427
+ custom: { type: 'string' },
428
+ },
429
+ };
430
+
431
+ const Overrides: NodeType = {
432
+ properties: {
433
+ DownloadButton: 'ButtonOverrides',
434
+ NextSectionButton: 'ButtonOverrides',
435
+ },
436
+ };
437
+
438
+ const RightPanel: NodeType = {
439
+ properties: {
440
+ backgroundColor: { type: 'string' },
441
+ panelBackgroundColor: { type: 'string' },
442
+ panelControlsBackgroundColor: { type: 'string' },
443
+ showAtBreakpoint: { type: 'string' },
444
+ textColor: { type: 'string' },
445
+ width: { type: 'string' },
446
+ },
447
+ };
448
+
449
+ const Shape: NodeType = {
450
+ properties: { borderRadius: { type: 'string' } },
451
+ };
452
+
453
+ const ThemeSpacing: NodeType = {
454
+ properties: {
455
+ sectionHorizontal: { type: 'number' },
456
+ sectionVertical: { type: 'number' },
457
+ unit: { type: 'number' },
458
+ },
459
+ };
460
+
94
461
  const ConfigTheme: NodeType = {
95
462
  properties: {
96
- breakpoints: { type: 'object', additionalProperties: { type: 'string' } },
97
- codeBlock: { type: 'object', additionalProperties: { type: 'string' } },
98
- colors: { type: 'object', additionalProperties: { type: 'string' } },
99
- components: { type: 'object', additionalProperties: { type: 'string' } },
100
- layout: { type: 'object', additionalProperties: { type: 'string' } },
101
- logo: { type: 'object', additionalProperties: { type: 'string' } },
102
- overrides: { type: 'object', additionalProperties: { type: 'string' } },
103
- rightPanel: { type: 'object', additionalProperties: { type: 'string' } },
104
- schema: { type: 'object', additionalProperties: { type: 'string' } },
105
- shape: { type: 'object', additionalProperties: { type: 'string' } },
106
- sidebar: { type: 'object', additionalProperties: { type: 'string' } },
107
- spacing: { type: 'object', additionalProperties: { type: 'string' } },
108
- typography: { type: 'object', additionalProperties: { type: 'string' } },
463
+ breakpoints: 'Breakpoints',
464
+ codeBlock: 'CodeBlock',
465
+ colors: 'ThemeColors',
466
+ components: 'Components',
467
+ layout: 'Layout',
468
+ logo: 'Logo',
469
+ overrides: 'Overrides',
470
+ rightPanel: 'RightPanel',
471
+ schema: 'Schema',
472
+ shape: 'Shape',
473
+ sidebar: 'Sidebar',
474
+ spacing: 'ThemeSpacing',
475
+ typography: 'Typography',
109
476
  links: { properties: { color: { type: 'string' } } },
110
477
  codeSample: { properties: { backgroundColor: { type: 'string' } } },
111
478
  },
112
- }
479
+ };
480
+
481
+ const GenerateCodeSamples: NodeType = {
482
+ properties: {
483
+ skipOptionalParameters: { type: 'boolean' },
484
+ languages: listOf('ConfigLanguage'),
485
+ },
486
+ };
113
487
 
114
488
  const ConfigReferenceDocs: NodeType = {
115
489
  properties: {
@@ -124,12 +498,7 @@ const ConfigReferenceDocs: NodeType = {
124
498
  expandDefaultServerVariables: { type: 'boolean' },
125
499
  expandResponses: { type: 'string' },
126
500
  expandSingleSchemaField: { type: 'boolean' },
127
- generateCodeSamples: {
128
- properties: {
129
- skipOptionalParameters: { type: 'boolean' },
130
- languages: listOf('ConfigLanguage'),
131
- },
132
- },
501
+ generateCodeSamples: 'GenerateCodeSamples',
133
502
  generatedPayloadSamplesMaxDepth: { type: 'number' },
134
503
  hideDownloadButton: { type: 'boolean' },
135
504
  hideHostname: { type: 'boolean' },
@@ -143,7 +512,7 @@ const ConfigReferenceDocs: NodeType = {
143
512
  htmlTemplate: { type: 'string' },
144
513
  jsonSampleExpandLevel: { type: 'string' },
145
514
  labels: 'ConfigLabels',
146
- layout: { type: 'object' },
515
+ layout: { type: 'string' },
147
516
  maxDisplayedEnumValues: { type: 'number' },
148
517
  menuToggle: { type: 'boolean' },
149
518
  nativeScrollbars: { type: 'boolean' },
@@ -192,4 +561,47 @@ export const ConfigTypes: Record<string, NodeType> = {
192
561
  ConfigLabels,
193
562
  ConfigSidebarLinks,
194
563
  ConfigTheme,
564
+ ThemeColors,
565
+ CommonThemeColors,
566
+ BorderThemeColors,
567
+ HttpColors,
568
+ ResponseColors,
569
+ SecondaryColors,
570
+ TextThemeColors,
571
+ Sizes,
572
+ ButtonsConfig,
573
+ CommonColorProps,
574
+ BadgeFontConfig,
575
+ BadgeSizes,
576
+ HttpBadgesConfig,
577
+ LabelControls,
578
+ Panels,
579
+ TryItButton,
580
+ Breakpoints,
581
+ StackedConfig,
582
+ ThreePanelConfig,
583
+ SchemaColorsConfig,
584
+ SizeProps,
585
+ Level1Items,
586
+ SpacingConfig,
587
+ FontConfig,
588
+ CodeConfig,
589
+ HeadingsConfig,
590
+ LinksConfig,
591
+ TokenProps,
592
+ CodeBlock,
593
+ Logo,
594
+ ButtonOverrides,
595
+ Overrides,
596
+ RightPanel,
597
+ Shape,
598
+ ThemeSpacing,
599
+ GenerateCodeSamples,
600
+ GroupItemsConfig,
601
+ Components,
602
+ Layout,
603
+ Schema,
604
+ Sidebar,
605
+ Heading,
606
+ Typography,
195
607
  };
@@ -1,5 +1,4 @@
1
1
  import { Referenced } from './openapi';
2
- //@ts-ignore
3
2
  import { Schema } from 'js-yaml';
4
3
 
5
4
  export interface Oas2Definition {