@redocly/openapi-core 1.0.0-beta.126 → 1.0.0-beta.127

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 (275) hide show
  1. package/lib/bundle.js +5 -2
  2. package/lib/rules/common/spec.js +1 -0
  3. package/lib/rules/oas2/request-mime-type.d.ts +1 -1
  4. package/lib/rules/oas2/response-mime-type.d.ts +1 -1
  5. package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.d.ts +2 -2
  6. package/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +3 -3
  7. package/lib/rules/oas3/request-mime-type.d.ts +1 -1
  8. package/lib/rules/oas3/response-mime-type.d.ts +1 -1
  9. package/lib/walk.d.ts +6 -5
  10. package/lib/walk.js +23 -27
  11. package/package.json +1 -1
  12. package/__tests__/utils.ts +0 -88
  13. package/src/__tests__/__snapshots__/bundle.test.ts.snap +0 -437
  14. package/src/__tests__/bundle.test.ts +0 -236
  15. package/src/__tests__/codeframes.test.ts +0 -530
  16. package/src/__tests__/fixtures/.redocly.lint-ignore.yaml +0 -5
  17. package/src/__tests__/fixtures/extension.js +0 -24
  18. package/src/__tests__/fixtures/refs/definitions.yaml +0 -3
  19. package/src/__tests__/fixtures/refs/examples.yaml +0 -8
  20. package/src/__tests__/fixtures/refs/external-request-body.yaml +0 -13
  21. package/src/__tests__/fixtures/refs/externalref.yaml +0 -35
  22. package/src/__tests__/fixtures/refs/hosted.yaml +0 -35
  23. package/src/__tests__/fixtures/refs/openapi-with-external-refs-conflicting-names.yaml +0 -21
  24. package/src/__tests__/fixtures/refs/openapi-with-external-refs.yaml +0 -33
  25. package/src/__tests__/fixtures/refs/openapi-with-url-refs.yaml +0 -18
  26. package/src/__tests__/fixtures/refs/param-b.yaml +0 -1
  27. package/src/__tests__/fixtures/refs/param-c.yaml +0 -1
  28. package/src/__tests__/fixtures/refs/rename.yaml +0 -1
  29. package/src/__tests__/fixtures/refs/requestBody.yaml +0 -9
  30. package/src/__tests__/fixtures/refs/schema-a.yaml +0 -1
  31. package/src/__tests__/fixtures/refs/simple.yaml +0 -1
  32. package/src/__tests__/fixtures/refs/vendor.schema.yaml +0 -20
  33. package/src/__tests__/fixtures/resolve/External.yaml +0 -10
  34. package/src/__tests__/fixtures/resolve/External2.yaml +0 -4
  35. package/src/__tests__/fixtures/resolve/description.md +0 -3
  36. package/src/__tests__/fixtures/resolve/externalInfo.yaml +0 -4
  37. package/src/__tests__/fixtures/resolve/externalLicense.yaml +0 -1
  38. package/src/__tests__/fixtures/resolve/openapi-with-back.yaml +0 -13
  39. package/src/__tests__/fixtures/resolve/openapi-with-md-description.yaml +0 -5
  40. package/src/__tests__/fixtures/resolve/openapi.yaml +0 -28
  41. package/src/__tests__/fixtures/resolve/schemas/type-a.yaml +0 -10
  42. package/src/__tests__/fixtures/resolve/schemas/type-b.yaml +0 -6
  43. package/src/__tests__/fixtures/resolve/transitive/a.yaml +0 -1
  44. package/src/__tests__/fixtures/resolve/transitive/components.yaml +0 -5
  45. package/src/__tests__/fixtures/resolve/transitive/schemas.yaml +0 -3
  46. package/src/__tests__/format.test.ts +0 -76
  47. package/src/__tests__/js-yaml.test.ts +0 -73
  48. package/src/__tests__/lint.test.ts +0 -388
  49. package/src/__tests__/logger-browser.test.ts +0 -53
  50. package/src/__tests__/logger.test.ts +0 -47
  51. package/src/__tests__/login.test.ts +0 -17
  52. package/src/__tests__/normalizeVisitors.test.ts +0 -151
  53. package/src/__tests__/output-browser.test.ts +0 -18
  54. package/src/__tests__/output.test.ts +0 -15
  55. package/src/__tests__/ref-utils.test.ts +0 -120
  56. package/src/__tests__/resolve-http.test.ts +0 -77
  57. package/src/__tests__/resolve.test.ts +0 -430
  58. package/src/__tests__/utils-browser.test.ts +0 -11
  59. package/src/__tests__/utils.test.ts +0 -144
  60. package/src/__tests__/walk.test.ts +0 -1545
  61. package/src/benchmark/benches/lint-with-many-rules.bench.ts +0 -35
  62. package/src/benchmark/benches/lint-with-nested-rule.bench.ts +0 -39
  63. package/src/benchmark/benches/lint-with-no-rules.bench.ts +0 -20
  64. package/src/benchmark/benches/lint-with-top-level-rule-report.bench.ts +0 -35
  65. package/src/benchmark/benches/lint-with-top-level-rule.bench.ts +0 -32
  66. package/src/benchmark/benches/rebilly.yaml +0 -32275
  67. package/src/benchmark/benches/recommended-oas3.bench.ts +0 -22
  68. package/src/benchmark/benches/resolve-with-no-external.bench.ts +0 -23
  69. package/src/benchmark/benchmark.js +0 -311
  70. package/src/benchmark/colors.js +0 -29
  71. package/src/benchmark/fork.js +0 -83
  72. package/src/benchmark/utils.ts +0 -36
  73. package/src/bundle.ts +0 -399
  74. package/src/config/__tests__/__snapshots__/config-resolvers.test.ts.snap +0 -161
  75. package/src/config/__tests__/__snapshots__/config.test.ts.snap +0 -144
  76. package/src/config/__tests__/config-resolvers.test.ts +0 -491
  77. package/src/config/__tests__/config.test.ts +0 -307
  78. package/src/config/__tests__/fixtures/ingore-file.ts +0 -8
  79. package/src/config/__tests__/fixtures/load-redocly.yaml +0 -2
  80. package/src/config/__tests__/fixtures/plugin-config.yaml +0 -2
  81. package/src/config/__tests__/fixtures/plugin.js +0 -56
  82. package/src/config/__tests__/fixtures/resolve-config/api/nested-config.yaml +0 -11
  83. package/src/config/__tests__/fixtures/resolve-config/api/plugin.js +0 -69
  84. package/src/config/__tests__/fixtures/resolve-config/local-config-with-circular.yaml +0 -7
  85. package/src/config/__tests__/fixtures/resolve-config/local-config-with-custom-function.yaml +0 -17
  86. package/src/config/__tests__/fixtures/resolve-config/local-config-with-file.yaml +0 -18
  87. package/src/config/__tests__/fixtures/resolve-config/local-config-with-wrong-custom-function.yaml +0 -15
  88. package/src/config/__tests__/fixtures/resolve-config/local-config.yaml +0 -9
  89. package/src/config/__tests__/fixtures/resolve-config/plugin.js +0 -80
  90. package/src/config/__tests__/fixtures/resolve-remote-configs/nested-remote-config.yaml +0 -3
  91. package/src/config/__tests__/fixtures/resolve-remote-configs/remote-config.yaml +0 -4
  92. package/src/config/__tests__/load.test.ts +0 -167
  93. package/src/config/__tests__/resolve-plugins.test.ts +0 -27
  94. package/src/config/__tests__/utils.test.ts +0 -204
  95. package/src/config/all.ts +0 -73
  96. package/src/config/builtIn.ts +0 -37
  97. package/src/config/config-resolvers.ts +0 -465
  98. package/src/config/config.ts +0 -330
  99. package/src/config/index.ts +0 -7
  100. package/src/config/load.ts +0 -144
  101. package/src/config/minimal.ts +0 -60
  102. package/src/config/recommended.ts +0 -60
  103. package/src/config/rules.ts +0 -54
  104. package/src/config/types.ts +0 -216
  105. package/src/config/utils.ts +0 -333
  106. package/src/decorators/__tests__/filter-in.test.ts +0 -310
  107. package/src/decorators/__tests__/filter-out.test.ts +0 -335
  108. package/src/decorators/__tests__/media-type-examples-override.test.ts +0 -665
  109. package/src/decorators/__tests__/remove-x-internal.test.ts +0 -316
  110. package/src/decorators/__tests__/resources/request.yaml +0 -3
  111. package/src/decorators/__tests__/resources/response.yaml +0 -3
  112. package/src/decorators/common/filters/filter-helper.ts +0 -72
  113. package/src/decorators/common/filters/filter-in.ts +0 -18
  114. package/src/decorators/common/filters/filter-out.ts +0 -18
  115. package/src/decorators/common/info-description-override.ts +0 -24
  116. package/src/decorators/common/info-override.ts +0 -15
  117. package/src/decorators/common/media-type-examples-override.ts +0 -79
  118. package/src/decorators/common/operation-description-override.ts +0 -30
  119. package/src/decorators/common/registry-dependencies.ts +0 -25
  120. package/src/decorators/common/remove-x-internal.ts +0 -59
  121. package/src/decorators/common/tag-description-override.ts +0 -25
  122. package/src/decorators/oas2/index.ts +0 -20
  123. package/src/decorators/oas3/index.ts +0 -22
  124. package/src/env.ts +0 -5
  125. package/src/format/codeframes.ts +0 -216
  126. package/src/format/format.ts +0 -375
  127. package/src/index.ts +0 -71
  128. package/src/js-yaml/index.ts +0 -14
  129. package/src/lint.ts +0 -130
  130. package/src/logger.ts +0 -34
  131. package/src/oas-types.ts +0 -57
  132. package/src/output.ts +0 -7
  133. package/src/redocly/__tests__/redocly-client.test.ts +0 -146
  134. package/src/redocly/index.ts +0 -187
  135. package/src/redocly/redocly-client-types.ts +0 -10
  136. package/src/redocly/registry-api-types.ts +0 -32
  137. package/src/redocly/registry-api.ts +0 -149
  138. package/src/ref-utils.ts +0 -85
  139. package/src/resolve.ts +0 -417
  140. package/src/rules/__tests__/fixtures/code-sample.php +0 -9
  141. package/src/rules/__tests__/fixtures/invalid-yaml.yaml +0 -1
  142. package/src/rules/__tests__/fixtures/ref.yaml +0 -1
  143. package/src/rules/__tests__/no-unresolved-refs.test.ts +0 -257
  144. package/src/rules/__tests__/utils.test.ts +0 -160
  145. package/src/rules/ajv.ts +0 -102
  146. package/src/rules/common/__tests__/info-license.test.ts +0 -62
  147. package/src/rules/common/__tests__/license-url.test.ts +0 -63
  148. package/src/rules/common/__tests__/no-ambiguous-paths.test.ts +0 -96
  149. package/src/rules/common/__tests__/no-enum-type-mismatch.test.ts +0 -210
  150. package/src/rules/common/__tests__/no-identical-paths.test.ts +0 -58
  151. package/src/rules/common/__tests__/no-path-trailing-slash.test.ts +0 -85
  152. package/src/rules/common/__tests__/operation-2xx-response.test.ts +0 -192
  153. package/src/rules/common/__tests__/operation-4xx-response.test.ts +0 -231
  154. package/src/rules/common/__tests__/operation-operationId-unique.test.ts +0 -76
  155. package/src/rules/common/__tests__/operation-operationId-url-safe.test.ts +0 -45
  156. package/src/rules/common/__tests__/operation-parameters-unique.test.ts +0 -167
  157. package/src/rules/common/__tests__/operation-singular-tag.test.ts +0 -72
  158. package/src/rules/common/__tests__/path-http-verbs-order.test.ts +0 -95
  159. package/src/rules/common/__tests__/path-not-include-query.test.ts +0 -64
  160. package/src/rules/common/__tests__/path-params-defined.test.ts +0 -202
  161. package/src/rules/common/__tests__/paths-kebab-case.test.ts +0 -108
  162. package/src/rules/common/__tests__/scalar-property-missing-example.test.ts +0 -264
  163. package/src/rules/common/__tests__/security-defined.test.ts +0 -175
  164. package/src/rules/common/__tests__/spec.test.ts +0 -555
  165. package/src/rules/common/__tests__/tag-description.test.ts +0 -65
  166. package/src/rules/common/__tests__/tags-alphabetical.test.ts +0 -64
  167. package/src/rules/common/assertions/__tests__/asserts.test.ts +0 -869
  168. package/src/rules/common/assertions/__tests__/index.test.ts +0 -100
  169. package/src/rules/common/assertions/__tests__/utils.test.ts +0 -236
  170. package/src/rules/common/assertions/asserts.ts +0 -357
  171. package/src/rules/common/assertions/index.ts +0 -56
  172. package/src/rules/common/assertions/utils.ts +0 -331
  173. package/src/rules/common/info-contact.ts +0 -15
  174. package/src/rules/common/info-license-url.ts +0 -10
  175. package/src/rules/common/info-license.ts +0 -15
  176. package/src/rules/common/no-ambiguous-paths.ts +0 -50
  177. package/src/rules/common/no-enum-type-mismatch.ts +0 -52
  178. package/src/rules/common/no-http-verbs-in-paths.ts +0 -36
  179. package/src/rules/common/no-identical-paths.ts +0 -24
  180. package/src/rules/common/no-invalid-parameter-examples.ts +0 -36
  181. package/src/rules/common/no-invalid-schema-examples.ts +0 -27
  182. package/src/rules/common/no-path-trailing-slash.ts +0 -15
  183. package/src/rules/common/operation-2xx-response.ts +0 -24
  184. package/src/rules/common/operation-4xx-response.ts +0 -24
  185. package/src/rules/common/operation-description.ts +0 -13
  186. package/src/rules/common/operation-operationId-unique.ts +0 -21
  187. package/src/rules/common/operation-operationId-url-safe.ts +0 -19
  188. package/src/rules/common/operation-operationId.ts +0 -17
  189. package/src/rules/common/operation-parameters-unique.ts +0 -48
  190. package/src/rules/common/operation-singular-tag.ts +0 -17
  191. package/src/rules/common/operation-summary.ts +0 -13
  192. package/src/rules/common/operation-tag-defined.ts +0 -26
  193. package/src/rules/common/parameter-description.ts +0 -22
  194. package/src/rules/common/path-declaration-must-exist.ts +0 -15
  195. package/src/rules/common/path-excludes-patterns.ts +0 -23
  196. package/src/rules/common/path-http-verbs-order.ts +0 -30
  197. package/src/rules/common/path-not-include-query.ts +0 -17
  198. package/src/rules/common/path-params-defined.ts +0 -65
  199. package/src/rules/common/path-segment-plural.ts +0 -31
  200. package/src/rules/common/paths-kebab-case.ts +0 -19
  201. package/src/rules/common/required-string-property-missing-min-length.ts +0 -44
  202. package/src/rules/common/response-contains-header.ts +0 -35
  203. package/src/rules/common/scalar-property-missing-example.ts +0 -58
  204. package/src/rules/common/security-defined.ts +0 -65
  205. package/src/rules/common/spec.ts +0 -174
  206. package/src/rules/common/tag-description.ts +0 -10
  207. package/src/rules/common/tags-alphabetical.ts +0 -20
  208. package/src/rules/no-unresolved-refs.ts +0 -51
  209. package/src/rules/oas2/__tests__/boolean-parameter-prefixes.test.ts +0 -110
  210. package/src/rules/oas2/__tests__/response-contains-header.test.ts +0 -174
  211. package/src/rules/oas2/__tests__/response-contains-property.test.ts +0 -155
  212. package/src/rules/oas2/__tests__/spec/fixtures/description.md +0 -1
  213. package/src/rules/oas2/__tests__/spec/info.test.ts +0 -355
  214. package/src/rules/oas2/__tests__/spec/operation.test.ts +0 -123
  215. package/src/rules/oas2/__tests__/spec/paths.test.ts +0 -245
  216. package/src/rules/oas2/__tests__/spec/referenceableScalars.test.ts +0 -35
  217. package/src/rules/oas2/__tests__/spec/utils.ts +0 -32
  218. package/src/rules/oas2/boolean-parameter-prefixes.ts +0 -26
  219. package/src/rules/oas2/index.ts +0 -89
  220. package/src/rules/oas2/remove-unused-components.ts +0 -81
  221. package/src/rules/oas2/request-mime-type.ts +0 -17
  222. package/src/rules/oas2/response-contains-property.ts +0 -36
  223. package/src/rules/oas2/response-mime-type.ts +0 -17
  224. package/src/rules/oas3/__tests__/boolean-parameter-prefixes.test.ts +0 -111
  225. package/src/rules/oas3/__tests__/fixtures/common.yaml +0 -11
  226. package/src/rules/oas3/__tests__/no-empty-enum-servers.com.test.ts +0 -205
  227. package/src/rules/oas3/__tests__/no-example-value-and-externalValue.test.ts +0 -65
  228. package/src/rules/oas3/__tests__/no-invalid-media-type-examples.test.ts +0 -473
  229. package/src/rules/oas3/__tests__/no-server-example.com.test.ts +0 -60
  230. package/src/rules/oas3/__tests__/no-server-trailing-slash.test.ts +0 -79
  231. package/src/rules/oas3/__tests__/no-unused-components.test.ts +0 -131
  232. package/src/rules/oas3/__tests__/operation-4xx-problem-details-rfc7807.test.ts +0 -145
  233. package/src/rules/oas3/__tests__/response-contains-header.test.ts +0 -389
  234. package/src/rules/oas3/__tests__/response-contains-property.test.ts +0 -403
  235. package/src/rules/oas3/__tests__/spec/callbacks.test.ts +0 -41
  236. package/src/rules/oas3/__tests__/spec/fixtures/description.md +0 -1
  237. package/src/rules/oas3/__tests__/spec/info.test.ts +0 -391
  238. package/src/rules/oas3/__tests__/spec/operation.test.ts +0 -253
  239. package/src/rules/oas3/__tests__/spec/paths.test.ts +0 -284
  240. package/src/rules/oas3/__tests__/spec/referenceableScalars.test.ts +0 -77
  241. package/src/rules/oas3/__tests__/spec/servers.test.ts +0 -505
  242. package/src/rules/oas3/__tests__/spec/spec.test.ts +0 -298
  243. package/src/rules/oas3/__tests__/spec/utils.ts +0 -32
  244. package/src/rules/oas3/__tests__/spec-components-invalid-map-name.test.ts +0 -305
  245. package/src/rules/oas3/boolean-parameter-prefixes.ts +0 -28
  246. package/src/rules/oas3/index.ts +0 -109
  247. package/src/rules/oas3/no-empty-servers.ts +0 -22
  248. package/src/rules/oas3/no-example-value-and-externalValue.ts +0 -14
  249. package/src/rules/oas3/no-invalid-media-type-examples.ts +0 -49
  250. package/src/rules/oas3/no-server-example.com.ts +0 -14
  251. package/src/rules/oas3/no-server-trailing-slash.ts +0 -15
  252. package/src/rules/oas3/no-server-variables-empty-enum.ts +0 -66
  253. package/src/rules/oas3/no-undefined-server-variable.ts +0 -30
  254. package/src/rules/oas3/no-unused-components.ts +0 -75
  255. package/src/rules/oas3/operation-4xx-problem-details-rfc7807.ts +0 -36
  256. package/src/rules/oas3/remove-unused-components.ts +0 -95
  257. package/src/rules/oas3/request-mime-type.ts +0 -31
  258. package/src/rules/oas3/response-contains-property.ts +0 -38
  259. package/src/rules/oas3/response-mime-type.ts +0 -31
  260. package/src/rules/oas3/spec-components-invalid-map-name.ts +0 -74
  261. package/src/rules/other/stats.ts +0 -73
  262. package/src/rules/utils.ts +0 -191
  263. package/src/types/index.ts +0 -149
  264. package/src/types/oas2.ts +0 -478
  265. package/src/types/oas3.ts +0 -597
  266. package/src/types/oas3_1.ts +0 -258
  267. package/src/types/redocly-yaml.ts +0 -1010
  268. package/src/typings/common.ts +0 -17
  269. package/src/typings/openapi.ts +0 -298
  270. package/src/typings/swagger.ts +0 -236
  271. package/src/utils.ts +0 -276
  272. package/src/visitors.ts +0 -491
  273. package/src/walk.ts +0 -453
  274. package/tsconfig.json +0 -8
  275. package/tsconfig.tsbuildinfo +0 -1
@@ -1,1010 +0,0 @@
1
- import { NodeType, listOf } from '.';
2
- import { omitObjectProps, pickObjectProps, isCustomRuleId } from '../utils';
3
-
4
- const builtInRulesList = [
5
- 'spec',
6
- 'info-contact',
7
- 'info-license',
8
- 'info-license-url',
9
- 'operation-2xx-response',
10
- 'operation-4xx-response',
11
- 'operation-4xx-problem-details-rfc7807',
12
- 'assertions',
13
- 'operation-operationId-unique',
14
- 'operation-parameters-unique',
15
- 'path-parameters-defined',
16
- 'operation-tag-defined',
17
- 'no-example-value-and-externalValue',
18
- 'no-enum-type-mismatch',
19
- 'no-path-trailing-slash',
20
- 'no-empty-servers',
21
- 'path-declaration-must-exist',
22
- 'operation-operationId-url-safe',
23
- 'operation-operationId',
24
- 'operation-summary',
25
- 'tags-alphabetical',
26
- 'no-server-example.com',
27
- 'no-server-trailing-slash',
28
- 'tag-description',
29
- 'operation-description',
30
- 'no-unused-components',
31
- 'path-not-include-query',
32
- 'path-params-defined',
33
- 'parameter-description',
34
- 'operation-singular-tag',
35
- 'security-defined',
36
- 'no-unresolved-refs',
37
- 'paths-kebab-case',
38
- 'boolean-parameter-prefixes',
39
- 'path-http-verbs-order',
40
- 'no-invalid-media-type-examples',
41
- 'no-identical-paths',
42
- 'no-ambiguous-paths',
43
- 'no-undefined-server-variable',
44
- 'no-server-variables-empty-enum',
45
- 'no-http-verbs-in-paths',
46
- 'path-excludes-patterns',
47
- 'request-mime-type',
48
- 'response-mime-type',
49
- 'path-segment-plural',
50
- 'no-invalid-schema-examples',
51
- 'no-invalid-parameter-examples',
52
- 'response-contains-header',
53
- 'response-contains-property',
54
- 'scalar-property-missing-example',
55
- 'spec-components-invalid-map-name',
56
- 'required-string-property-missing-min-length',
57
- ];
58
- const nodeTypesList = [
59
- 'any',
60
- 'Root',
61
- 'Tag',
62
- 'TagList',
63
- 'ExternalDocs',
64
- 'Server',
65
- 'ServerList',
66
- 'ServerVariable',
67
- 'ServerVariablesMap',
68
- 'SecurityRequirement',
69
- 'SecurityRequirementList',
70
- 'Info',
71
- 'Contact',
72
- 'License',
73
- 'Paths',
74
- 'PathItem',
75
- 'Parameter',
76
- 'ParameterList',
77
- 'Operation',
78
- 'Callback',
79
- 'CallbacksMap',
80
- 'RequestBody',
81
- 'MediaTypesMap',
82
- 'MediaType',
83
- 'Example',
84
- 'ExamplesMap',
85
- 'Encoding',
86
- 'EncodingMap',
87
- 'Header',
88
- 'HeadersMap',
89
- 'Responses',
90
- 'Response',
91
- 'Link',
92
- 'LinksMap',
93
- 'Schema',
94
- 'Xml',
95
- 'SchemaProperties',
96
- 'DiscriminatorMapping',
97
- 'Discriminator',
98
- 'Components',
99
- 'NamedSchemas',
100
- 'NamedResponses',
101
- 'NamedParameters',
102
- 'NamedExamples',
103
- 'NamedRequestBodies',
104
- 'NamedHeaders',
105
- 'NamedSecuritySchemes',
106
- 'NamedLinks',
107
- 'NamedCallbacks',
108
- 'ImplicitFlow',
109
- 'PasswordFlow',
110
- 'ClientCredentials',
111
- 'AuthorizationCode',
112
- 'OAuth2Flows',
113
- 'SecurityScheme',
114
- 'XCodeSample',
115
- 'XCodeSampleList',
116
- 'WebhooksMap',
117
- 'SpecExtension',
118
- ];
119
-
120
- const ConfigStyleguide: NodeType = {
121
- properties: {
122
- extends: {
123
- type: 'array',
124
- items: {
125
- type: 'string',
126
- },
127
- },
128
- rules: 'Rules',
129
- oas2Rules: 'Rules',
130
- oas3_0Rules: 'Rules',
131
- oas3_1Rules: 'Rules',
132
- preprocessors: { type: 'object' },
133
- oas2Preprocessors: { type: 'object' },
134
- oas3_0Preprocessors: { type: 'object' },
135
- oas3_1Preprocessors: { type: 'object' },
136
- decorators: { type: 'object' },
137
- oas2Decorators: { type: 'object' },
138
- oas3_0Decorators: { type: 'object' },
139
- oas3_1Decorators: { type: 'object' },
140
- },
141
- };
142
-
143
- const RootConfigStyleguide: NodeType = {
144
- properties: {
145
- plugins: {
146
- type: 'array',
147
- items: { type: 'string' },
148
- },
149
- ...ConfigStyleguide.properties,
150
- },
151
- };
152
-
153
- const ConfigRoot: NodeType = {
154
- properties: {
155
- organization: { type: 'string' },
156
- apis: 'ConfigApis',
157
- ...RootConfigStyleguide.properties,
158
- theme: 'ConfigRootTheme',
159
- 'features.openapi': 'ConfigReferenceDocs', // deprecated
160
- 'features.mockServer': 'ConfigMockServer', // deprecated
161
- region: { enum: ['us', 'eu'] },
162
- resolve: {
163
- properties: {
164
- http: 'ConfigHTTP',
165
- doNotResolveExamples: { type: 'boolean' },
166
- },
167
- },
168
- files: {
169
- type: 'array',
170
- items: {
171
- type: 'string',
172
- },
173
- },
174
- },
175
- };
176
-
177
- const ConfigApis: NodeType = {
178
- properties: {},
179
- additionalProperties: 'ConfigApisProperties',
180
- };
181
-
182
- const ConfigApisProperties: NodeType = {
183
- properties: {
184
- root: { type: 'string' },
185
- labels: {
186
- type: 'array',
187
- items: {
188
- type: 'string',
189
- },
190
- },
191
- lint: 'ConfigStyleguide', // deprecated
192
- styleguide: 'ConfigStyleguide', // deprecated
193
- ...ConfigStyleguide.properties,
194
- 'features.openapi': 'ConfigReferenceDocs', // deprecated
195
- 'features.mockServer': 'ConfigMockServer', // deprecated
196
- theme: 'ConfigRootTheme',
197
- files: {
198
- type: 'array',
199
- items: {
200
- type: 'string',
201
- },
202
- },
203
- },
204
- required: ['root'],
205
- };
206
-
207
- const ConfigHTTP: NodeType = {
208
- properties: {
209
- headers: {
210
- type: 'array',
211
- items: {
212
- type: 'string',
213
- },
214
- },
215
- },
216
- };
217
-
218
- const ConfigRootTheme: NodeType = {
219
- properties: {
220
- openapi: 'ConfigReferenceDocs',
221
- mockServer: 'ConfigMockServer',
222
- },
223
- };
224
-
225
- const Rules: NodeType = {
226
- properties: {},
227
- additionalProperties: (value: unknown, key: string) => {
228
- if (key.startsWith('assert/')) {
229
- return 'Assert';
230
- } else if (builtInRulesList.includes(key) || isCustomRuleId(key)) {
231
- if (typeof value === 'string') {
232
- return { enum: ['error', 'warn', 'off'] };
233
- } else {
234
- return 'ObjectRule';
235
- }
236
- }
237
- // Otherwise is considered as invalid
238
- return;
239
- },
240
- };
241
-
242
- const ObjectRule: NodeType = {
243
- properties: {
244
- severity: { enum: ['error', 'warn', 'off'] },
245
- },
246
- additionalProperties: {},
247
- required: ['severity'],
248
- };
249
-
250
- const AssertionDefinitionSubject: NodeType = {
251
- properties: {
252
- type: { enum: nodeTypesList },
253
- property: (value: unknown) => {
254
- if (Array.isArray(value)) {
255
- return { type: 'array', items: { type: 'string' } };
256
- } else if (value === null) {
257
- return null;
258
- } else {
259
- return { type: 'string' };
260
- }
261
- },
262
- filterInParentKeys: { type: 'array', items: { type: 'string' } },
263
- filterOutParentKeys: { type: 'array', items: { type: 'string' } },
264
- matchParentKeys: { type: 'string' },
265
- },
266
- required: ['type'],
267
- };
268
-
269
- const AssertionDefinitionAssertions: NodeType = {
270
- properties: {
271
- enum: { type: 'array', items: { type: 'string' } },
272
- pattern: { type: 'string' },
273
- notPattern: { type: 'string' },
274
- casing: {
275
- enum: [
276
- 'camelCase',
277
- 'kebab-case',
278
- 'snake_case',
279
- 'PascalCase',
280
- 'MACRO_CASE',
281
- 'COBOL-CASE',
282
- 'flatcase',
283
- ],
284
- },
285
- mutuallyExclusive: { type: 'array', items: { type: 'string' } },
286
- mutuallyRequired: { type: 'array', items: { type: 'string' } },
287
- required: { type: 'array', items: { type: 'string' } },
288
- requireAny: { type: 'array', items: { type: 'string' } },
289
- disallowed: { type: 'array', items: { type: 'string' } },
290
- defined: { type: 'boolean' },
291
- // undefined: { type: 'boolean' }, // TODO: Remove `undefined` assertion from codebase overall
292
- nonEmpty: { type: 'boolean' },
293
- minLength: { type: 'integer' },
294
- maxLength: { type: 'integer' },
295
- ref: (value: string | boolean) =>
296
- typeof value === 'string' ? { type: 'string' } : { type: 'boolean' },
297
- const: (value: string | boolean | number) => {
298
- if (typeof value === 'string') {
299
- return { type: 'string' };
300
- }
301
- if (typeof value === 'number') {
302
- return { type: 'number' };
303
- }
304
- if (typeof value === 'boolean') {
305
- return { type: 'boolean' };
306
- } else {
307
- return;
308
- }
309
- },
310
- },
311
- additionalProperties: (_value: unknown, key: string) => {
312
- if (/^\w+\/\w+$/.test(key)) return { type: 'object' };
313
- return;
314
- },
315
- };
316
-
317
- const AssertDefinition: NodeType = {
318
- properties: {
319
- subject: 'AssertionDefinitionSubject',
320
- assertions: 'AssertionDefinitionAssertions',
321
- },
322
- required: ['subject', 'assertions'],
323
- };
324
-
325
- const Assert: NodeType = {
326
- properties: {
327
- subject: 'AssertionDefinitionSubject',
328
- assertions: 'AssertionDefinitionAssertions',
329
- where: listOf('AssertDefinition'),
330
- message: { type: 'string' },
331
- suggest: { type: 'array', items: { type: 'string' } },
332
- severity: { enum: ['error', 'warn', 'off'] },
333
- },
334
- required: ['subject', 'assertions'],
335
- };
336
-
337
- const ConfigLanguage: NodeType = {
338
- properties: {
339
- label: { type: 'string' },
340
- lang: {
341
- enum: [
342
- 'curl',
343
- 'C#',
344
- 'Go',
345
- 'Java',
346
- 'Java8+Apache',
347
- 'JavaScript',
348
- 'Node.js',
349
- 'PHP',
350
- 'Python',
351
- 'R',
352
- 'Ruby',
353
- ],
354
- },
355
- },
356
- required: ['lang'],
357
- };
358
-
359
- const ConfigLabels: NodeType = {
360
- properties: {
361
- enum: { type: 'string' },
362
- enumSingleValue: { type: 'string' },
363
- enumArray: { type: 'string' },
364
- default: { type: 'string' },
365
- deprecated: { type: 'string' },
366
- example: { type: 'string' },
367
- examples: { type: 'string' },
368
- nullable: { type: 'string' },
369
- recursive: { type: 'string' },
370
- arrayOf: { type: 'string' },
371
- webhook: { type: 'string' },
372
- authorizations: { type: 'string' },
373
- tryItAuthBasicUsername: { type: 'string' },
374
- tryItAuthBasicPassword: { type: 'string' },
375
- },
376
- };
377
-
378
- const ConfigSidebarLinks: NodeType = {
379
- properties: {
380
- beforeInfo: listOf('CommonConfigSidebarLinks'),
381
- end: listOf('CommonConfigSidebarLinks'),
382
- },
383
- };
384
-
385
- const CommonConfigSidebarLinks: NodeType = {
386
- properties: {
387
- label: { type: 'string' },
388
- link: { type: 'string' },
389
- target: { type: 'string' },
390
- },
391
- required: ['label', 'link'],
392
- };
393
-
394
- const CommonThemeColors: NodeType = {
395
- properties: {
396
- main: { type: 'string' },
397
- light: { type: 'string' },
398
- dark: { type: 'string' },
399
- contrastText: { type: 'string' },
400
- },
401
- };
402
-
403
- const CommonColorProps: NodeType = {
404
- properties: {
405
- backgroundColor: { type: 'string' },
406
- borderColor: { type: 'string' },
407
- color: { type: 'string' },
408
- tabTextColor: { type: 'string' },
409
- },
410
- };
411
-
412
- const BorderThemeColors: NodeType = {
413
- properties: pickObjectProps(CommonThemeColors.properties, ['light', 'dark']),
414
- };
415
-
416
- const HttpColors: NodeType = {
417
- properties: {
418
- basic: { type: 'string' },
419
- delete: { type: 'string' },
420
- get: { type: 'string' },
421
- head: { type: 'string' },
422
- link: { type: 'string' },
423
- options: { type: 'string' },
424
- patch: { type: 'string' },
425
- post: { type: 'string' },
426
- put: { type: 'string' },
427
- },
428
- };
429
-
430
- const ResponseColors: NodeType = {
431
- properties: {
432
- error: 'CommonColorProps',
433
- info: 'CommonColorProps',
434
- redirect: 'CommonColorProps',
435
- success: 'CommonColorProps',
436
- },
437
- };
438
-
439
- const SecondaryColors: NodeType = {
440
- properties: omitObjectProps(CommonThemeColors.properties, ['dark']),
441
- };
442
-
443
- const TextThemeColors: NodeType = {
444
- properties: {
445
- primary: { type: 'string' },
446
- secondary: { type: 'string' },
447
- light: { type: 'string' },
448
- },
449
- };
450
-
451
- const ThemeColors: NodeType = {
452
- properties: {
453
- accent: 'CommonThemeColors',
454
- border: 'BorderThemeColors',
455
- error: 'CommonThemeColors',
456
- http: 'HttpColors',
457
- primary: 'CommonThemeColors',
458
- responses: 'ResponseColors',
459
- secondary: 'SecondaryColors',
460
- success: 'CommonThemeColors',
461
- text: 'TextThemeColors',
462
- tonalOffset: { type: 'number' },
463
- warning: 'CommonThemeColors',
464
- },
465
- };
466
-
467
- const SizeProps: NodeType = {
468
- properties: {
469
- fontSize: { type: 'string' },
470
- padding: { type: 'string' },
471
- minWidth: { type: 'string' },
472
- },
473
- };
474
-
475
- const Sizes: NodeType = {
476
- properties: {
477
- small: 'SizeProps',
478
- medium: 'SizeProps',
479
- large: 'SizeProps',
480
- xlarge: 'SizeProps',
481
- },
482
- };
483
-
484
- const FontConfig: NodeType = {
485
- properties: {
486
- fontFamily: { type: 'string' },
487
- fontSize: { type: 'string' },
488
- fontWeight: { type: 'string' },
489
- lineHeight: { type: 'string' },
490
- },
491
- };
492
-
493
- const ButtonsConfig: NodeType = {
494
- properties: {
495
- ...omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
496
- borderRadius: { type: 'string' },
497
- hoverStyle: { type: 'string' },
498
- boxShadow: { type: 'string' },
499
- hoverBoxShadow: { type: 'string' },
500
- sizes: 'Sizes',
501
- },
502
- };
503
-
504
- const BadgeFontConfig: NodeType = {
505
- properties: pickObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
506
- };
507
-
508
- const BadgeSizes: NodeType = {
509
- properties: {
510
- medium: 'BadgeFontConfig',
511
- small: 'BadgeFontConfig',
512
- },
513
- };
514
-
515
- const HttpBadgesConfig: NodeType = {
516
- properties: {
517
- ...omitObjectProps(FontConfig.properties, ['fontSize', 'lineHeight']),
518
- borderRadius: { type: 'string' },
519
- color: { type: 'string' },
520
- sizes: 'BadgeSizes',
521
- },
522
- };
523
-
524
- const LabelControls: NodeType = {
525
- properties: {
526
- top: { type: 'string' },
527
- width: { type: 'string' },
528
- height: { type: 'string' },
529
- },
530
- };
531
-
532
- const Panels: NodeType = {
533
- properties: {
534
- borderRadius: { type: 'string' },
535
- backgroundColor: { type: 'string' },
536
- },
537
- };
538
-
539
- const TryItButton: NodeType = {
540
- properties: {
541
- fullWidth: { type: 'boolean' },
542
- },
543
- };
544
-
545
- const Components: NodeType = {
546
- properties: {
547
- buttons: 'ButtonsConfig',
548
- httpBadges: 'HttpBadgesConfig',
549
- layoutControls: 'LabelControls',
550
- panels: 'Panels',
551
- tryItButton: 'TryItButton',
552
- tryItSendButton: 'TryItButton',
553
- },
554
- };
555
-
556
- const Breakpoints: NodeType = {
557
- properties: {
558
- small: { type: 'string' },
559
- medium: { type: 'string' },
560
- large: { type: 'string' },
561
- },
562
- };
563
-
564
- const StackedConfig: NodeType = {
565
- properties: {
566
- maxWidth: 'Breakpoints',
567
- },
568
- };
569
-
570
- const ThreePanelConfig: NodeType = {
571
- properties: {
572
- maxWidth: 'Breakpoints',
573
- middlePanelMaxWidth: 'Breakpoints',
574
- },
575
- };
576
-
577
- const Layout: NodeType = {
578
- properties: {
579
- showDarkRightPanel: { type: 'boolean' },
580
- stacked: 'StackedConfig',
581
- 'three-panel': 'ThreePanelConfig',
582
- },
583
- };
584
-
585
- const SchemaColorsConfig: NodeType = {
586
- properties: {
587
- backgroundColor: { type: 'string' },
588
- border: { type: 'string' },
589
- },
590
- };
591
-
592
- const Schema: NodeType = {
593
- properties: {
594
- breakFieldNames: { type: 'boolean' },
595
- caretColor: { type: 'string' },
596
- caretSize: { type: 'string' },
597
- constraints: 'SchemaColorsConfig',
598
- defaultDetailsWidth: { type: 'string' },
599
- examples: 'SchemaColorsConfig',
600
- labelsTextSize: { type: 'string' },
601
- linesColor: { type: 'string' },
602
- nestedBackground: { type: 'string' },
603
- nestingSpacing: { type: 'string' },
604
- requireLabelColor: { type: 'string' },
605
- typeNameColor: { type: 'string' },
606
- typeTitleColor: { type: 'string' },
607
- },
608
- };
609
-
610
- const GroupItemsConfig: NodeType = {
611
- properties: {
612
- subItemsColor: { type: 'string' },
613
- textTransform: { type: 'string' },
614
- fontWeight: { type: 'string' },
615
- },
616
- };
617
-
618
- const Level1Items: NodeType = {
619
- properties: pickObjectProps(GroupItemsConfig.properties, ['textTransform']),
620
- };
621
-
622
- const SpacingConfig: NodeType = {
623
- properties: {
624
- unit: { type: 'number' },
625
- paddingHorizontal: { type: 'string' },
626
- paddingVertical: { type: 'string' },
627
- offsetTop: { type: 'string' },
628
- offsetLeft: { type: 'string' },
629
- offsetNesting: { type: 'string' },
630
- },
631
- };
632
-
633
- const Sidebar: NodeType = {
634
- properties: {
635
- ...omitObjectProps(FontConfig.properties, ['fontWeight', 'lineHeight']),
636
- activeBgColor: { type: 'string' },
637
- activeTextColor: { type: 'string' },
638
- backgroundColor: { type: 'string' },
639
- borderRadius: { type: 'string' },
640
- breakPath: { type: 'boolean' },
641
- caretColor: { type: 'string' },
642
- caretSize: { type: 'string' },
643
- groupItems: 'GroupItemsConfig',
644
- level1items: 'Level1Items',
645
- rightLineColor: { type: 'string' },
646
- separatorLabelColor: { type: 'string' },
647
- showAtBreakpoint: { type: 'string' },
648
- spacing: 'SpacingConfig',
649
- textColor: { type: 'string' },
650
- width: { type: 'string' },
651
- },
652
- };
653
-
654
- const Heading: NodeType = {
655
- properties: {
656
- ...FontConfig.properties,
657
- color: { type: 'string' },
658
- transform: { type: 'string' },
659
- },
660
- };
661
-
662
- const CodeConfig: NodeType = {
663
- properties: {
664
- ...FontConfig.properties,
665
- backgroundColor: { type: 'string' },
666
- color: { type: 'string' },
667
- wordBreak: {
668
- enum: [
669
- 'break-all',
670
- 'break-word',
671
- 'keep-all',
672
- 'normal',
673
- 'revert',
674
- 'unset',
675
- 'inherit',
676
- 'initial',
677
- ],
678
- },
679
- wrap: { type: 'boolean' },
680
- },
681
- };
682
-
683
- const HeadingsConfig: NodeType = {
684
- properties: omitObjectProps(FontConfig.properties, ['fontSize']),
685
- };
686
-
687
- const LinksConfig: NodeType = {
688
- properties: {
689
- color: { type: 'string' },
690
- hover: { type: 'string' },
691
- textDecoration: { type: 'string' },
692
- hoverTextDecoration: { type: 'string' },
693
- visited: { type: 'string' },
694
- },
695
- };
696
-
697
- const Typography: NodeType = {
698
- properties: {
699
- code: 'CodeConfig',
700
- fieldName: 'FontConfig',
701
- ...pickObjectProps(FontConfig.properties, ['fontSize', 'fontFamily']),
702
- fontWeightBold: { type: 'string' },
703
- fontWeightLight: { type: 'string' },
704
- fontWeightRegular: { type: 'string' },
705
- heading1: 'Heading',
706
- heading2: 'Heading',
707
- heading3: 'Heading',
708
- headings: 'HeadingsConfig',
709
- lineHeight: { type: 'string' },
710
- links: 'LinksConfig',
711
- optimizeSpeed: { type: 'boolean' },
712
- rightPanelHeading: 'Heading',
713
- smoothing: { enum: ['auto', 'none', 'antialiased', 'subpixel-antialiased', 'grayscale'] },
714
- },
715
- };
716
-
717
- const TokenProps: NodeType = {
718
- properties: {
719
- color: { type: 'string' },
720
- ...omitObjectProps(FontConfig.properties, ['fontWeight']),
721
- },
722
- };
723
-
724
- const CodeBlock: NodeType = {
725
- properties: {
726
- backgroundColor: { type: 'string' },
727
- borderRadius: { type: 'string' },
728
- tokens: 'TokenProps',
729
- },
730
- };
731
-
732
- const Logo: NodeType = {
733
- properties: {
734
- gutter: { type: 'string' },
735
- maxHeight: { type: 'string' },
736
- maxWidth: { type: 'string' },
737
- },
738
- };
739
-
740
- const Fab: NodeType = {
741
- properties: {
742
- backgroundColor: { type: 'string' },
743
- color: { type: 'string' },
744
- },
745
- };
746
-
747
- const ButtonOverrides: NodeType = {
748
- properties: {
749
- custom: { type: 'string' },
750
- },
751
- };
752
-
753
- const Overrides: NodeType = {
754
- properties: {
755
- DownloadButton: 'ButtonOverrides',
756
- NextSectionButton: 'ButtonOverrides',
757
- },
758
- };
759
-
760
- const RightPanel: NodeType = {
761
- properties: {
762
- backgroundColor: { type: 'string' },
763
- panelBackgroundColor: { type: 'string' },
764
- panelControlsBackgroundColor: { type: 'string' },
765
- showAtBreakpoint: { type: 'string' },
766
- textColor: { type: 'string' },
767
- width: { type: 'string' },
768
- },
769
- };
770
-
771
- const Shape: NodeType = {
772
- properties: { borderRadius: { type: 'string' } },
773
- };
774
-
775
- const ThemeSpacing: NodeType = {
776
- properties: {
777
- sectionHorizontal: { type: 'number' },
778
- sectionVertical: { type: 'number' },
779
- unit: { type: 'number' },
780
- },
781
- };
782
-
783
- const ConfigTheme: NodeType = {
784
- properties: {
785
- breakpoints: 'Breakpoints',
786
- codeBlock: 'CodeBlock',
787
- colors: 'ThemeColors',
788
- components: 'Components',
789
- layout: 'Layout',
790
- logo: 'Logo',
791
- fab: 'Fab',
792
- overrides: 'Overrides',
793
- rightPanel: 'RightPanel',
794
- schema: 'Schema',
795
- shape: 'Shape',
796
- sidebar: 'Sidebar',
797
- spacing: 'ThemeSpacing',
798
- typography: 'Typography',
799
- links: { properties: { color: { type: 'string' } } }, // deprecated
800
- codeSample: { properties: { backgroundColor: { type: 'string' } } }, // deprecated
801
- },
802
- };
803
-
804
- const GenerateCodeSamples: NodeType = {
805
- properties: {
806
- skipOptionalParameters: { type: 'boolean' },
807
- languages: listOf('ConfigLanguage'),
808
- },
809
- required: ['languages'],
810
- };
811
-
812
- const ConfigReferenceDocs: NodeType = {
813
- properties: {
814
- theme: 'ConfigTheme',
815
- corsProxyUrl: { type: 'string' },
816
- ctrlFHijack: { type: 'boolean' },
817
- defaultSampleLanguage: { type: 'string' },
818
- disableDeepLinks: { type: 'boolean' },
819
- disableSearch: { type: 'boolean' },
820
- disableSidebar: { type: 'boolean' },
821
- downloadDefinitionUrl: { type: 'string' },
822
- expandDefaultServerVariables: { type: 'boolean' },
823
- enumSkipQuotes: { type: 'boolean' },
824
- expandDefaultRequest: { type: 'boolean' },
825
- expandDefaultResponse: { type: 'boolean' },
826
- expandResponses: { type: 'string' },
827
- expandSingleSchemaField: { type: 'boolean' },
828
- generateCodeSamples: 'GenerateCodeSamples',
829
- generatedPayloadSamplesMaxDepth: { type: 'number' },
830
- hideDownloadButton: { type: 'boolean' },
831
- hideHostname: { type: 'boolean' },
832
- hideInfoSection: { type: 'boolean' },
833
- hideLoading: { type: 'boolean' },
834
- hideLogo: { type: 'boolean' },
835
- hideRequestPayloadSample: { type: 'boolean' },
836
- hideRightPanel: { type: 'boolean' },
837
- hideSchemaPattern: { type: 'boolean' },
838
- hideSchemaTitles: { type: 'boolean' },
839
- hideSingleRequestSampleTab: { type: 'boolean' },
840
- hideSecuritySection: { type: 'boolean' },
841
- hideTryItPanel: { type: 'boolean' },
842
- hideFab: { type: 'boolean' },
843
- hideOneOfDescription: { type: 'boolean' },
844
- htmlTemplate: { type: 'string' },
845
- jsonSampleExpandLevel: (value: unknown) => {
846
- if (typeof value === 'number') {
847
- return { type: 'number', minimum: 1 };
848
- } else {
849
- return { type: 'string' };
850
- }
851
- },
852
- labels: 'ConfigLabels',
853
- layout: { enum: ['stacked', 'three-panel'] },
854
- maxDisplayedEnumValues: { type: 'number' },
855
- menuToggle: { type: 'boolean' },
856
- nativeScrollbars: { type: 'boolean' },
857
- noAutoAuth: { type: 'boolean' }, // deprecated
858
- oAuth2RedirectURI: { type: 'string' },
859
- onDeepLinkClick: { type: 'object' },
860
- onlyRequiredInSamples: { type: 'boolean' },
861
- pagination: { enum: ['none', 'section', 'item'] },
862
- pathInMiddlePanel: { type: 'boolean' },
863
- payloadSampleIdx: { type: 'number', minimum: 0 },
864
- requestInterceptor: { type: 'object' },
865
- requiredPropsFirst: { type: 'boolean' },
866
- routingBasePath: { type: 'string' },
867
- routingStrategy: { type: 'string' }, // deprecated
868
- samplesTabsMaxCount: { type: 'number' },
869
- schemaExpansionLevel: (value: unknown) => {
870
- if (typeof value === 'number') {
871
- return { type: 'number', minimum: 0 };
872
- } else {
873
- return { type: 'string' };
874
- }
875
- },
876
- schemaDefinitionsTagName: { type: 'string' },
877
- minCharacterLengthToInitSearch: { type: 'number', minimum: 1 },
878
- maxResponseHeadersToShowInTryIt: { type: 'number', minimum: 0 },
879
- scrollYOffset: (value: unknown) => {
880
- if (typeof value === 'number') {
881
- return { type: 'number' };
882
- } else {
883
- return { type: 'string' };
884
- }
885
- },
886
- searchAutoExpand: { type: 'boolean' },
887
- searchFieldLevelBoost: { type: 'number', minimum: 0 },
888
- searchMaxDepth: { type: 'number', minimum: 1 },
889
- searchMode: { enum: ['default', 'path-only'] },
890
- searchOperationTitleBoost: { type: 'number' },
891
- searchTagTitleBoost: { type: 'number' },
892
- sendXUserAgentInTryIt: { type: 'boolean' },
893
- showChangeLayoutButton: { type: 'boolean' },
894
- showConsole: { type: 'boolean' }, // deprecated
895
- showExtensions: (value: unknown) => {
896
- if (typeof value === 'boolean') {
897
- return { type: 'boolean' };
898
- } else {
899
- return {
900
- type: 'array',
901
- items: {
902
- type: 'string',
903
- },
904
- };
905
- }
906
- },
907
- showNextButton: { type: 'boolean' },
908
- showRightPanelToggle: { type: 'boolean' },
909
- showSecuritySchemeType: { type: 'boolean' },
910
- showWebhookVerb: { type: 'boolean' },
911
- showObjectSchemaExamples: { type: 'boolean' },
912
- disableTryItRequestUrlEncoding: { type: 'boolean' },
913
- sidebarLinks: 'ConfigSidebarLinks',
914
- sideNavStyle: { enum: ['summary-only', 'path-first', 'id-only'] },
915
- simpleOneOfTypeLabel: { type: 'boolean' },
916
- sortEnumValuesAlphabetically: { type: 'boolean' },
917
- sortOperationsAlphabetically: { type: 'boolean' },
918
- sortPropsAlphabetically: { type: 'boolean' },
919
- sortTagsAlphabetically: { type: 'boolean' },
920
- suppressWarnings: { type: 'boolean' }, // deprecated
921
- unstable_externalDescription: { type: 'boolean' }, // deprecated
922
- unstable_ignoreMimeParameters: { type: 'boolean' },
923
- untrustedDefinition: { type: 'boolean' },
924
- mockServer: {
925
- properties: {
926
- url: { type: 'string' },
927
- position: { enum: ['first', 'last', 'replace', 'off'] },
928
- description: { type: 'string' },
929
- },
930
- },
931
- showAccessMode: { type: 'boolean' },
932
- preserveOriginalExtensionsName: { type: 'boolean' },
933
- markdownHeadingsAnchorLevel: { type: 'number' },
934
- },
935
- additionalProperties: { type: 'string' },
936
- };
937
-
938
- const ConfigMockServer: NodeType = {
939
- properties: {
940
- strictExamples: { type: 'boolean' },
941
- errorIfForcedExampleNotFound: { type: 'boolean' },
942
- },
943
- };
944
-
945
- export const ConfigTypes: Record<string, NodeType> = {
946
- Assert,
947
- ConfigRoot,
948
- ConfigApis,
949
- ConfigApisProperties,
950
- RootConfigStyleguide,
951
- ConfigStyleguide,
952
- ConfigReferenceDocs,
953
- ConfigMockServer,
954
- ConfigHTTP,
955
- ConfigLanguage,
956
- ConfigLabels,
957
- ConfigSidebarLinks,
958
- CommonConfigSidebarLinks,
959
- ConfigTheme,
960
- ConfigRootTheme,
961
- AssertDefinition,
962
- ThemeColors,
963
- CommonThemeColors,
964
- BorderThemeColors,
965
- HttpColors,
966
- ResponseColors,
967
- SecondaryColors,
968
- TextThemeColors,
969
- Sizes,
970
- ButtonsConfig,
971
- CommonColorProps,
972
- BadgeFontConfig,
973
- BadgeSizes,
974
- HttpBadgesConfig,
975
- LabelControls,
976
- Panels,
977
- TryItButton,
978
- Breakpoints,
979
- StackedConfig,
980
- ThreePanelConfig,
981
- SchemaColorsConfig,
982
- SizeProps,
983
- Level1Items,
984
- SpacingConfig,
985
- FontConfig,
986
- CodeConfig,
987
- HeadingsConfig,
988
- LinksConfig,
989
- TokenProps,
990
- CodeBlock,
991
- Logo,
992
- Fab,
993
- ButtonOverrides,
994
- Overrides,
995
- ObjectRule,
996
- RightPanel,
997
- Rules,
998
- Shape,
999
- ThemeSpacing,
1000
- GenerateCodeSamples,
1001
- GroupItemsConfig,
1002
- Components,
1003
- Layout,
1004
- Schema,
1005
- Sidebar,
1006
- Heading,
1007
- Typography,
1008
- AssertionDefinitionAssertions,
1009
- AssertionDefinitionSubject,
1010
- };