@redocly/openapi-core 0.0.0-snapshot.1769439476 → 0.0.0-snapshot.1769511679

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 (45) hide show
  1. package/lib/config/load.d.ts +1 -1
  2. package/lib/config/load.d.ts.map +1 -1
  3. package/lib/config/load.js +2 -2
  4. package/lib/config/load.js.map +1 -1
  5. package/lib/oas-types.d.ts +190 -0
  6. package/lib/oas-types.d.ts.map +1 -1
  7. package/lib/types/arazzo.d.ts.map +1 -1
  8. package/lib/types/arazzo.js +210 -44
  9. package/lib/types/arazzo.js.map +1 -1
  10. package/lib/types/asyncapi2.d.ts.map +1 -1
  11. package/lib/types/asyncapi2.js +385 -57
  12. package/lib/types/asyncapi2.js.map +1 -1
  13. package/lib/types/asyncapi3.d.ts.map +1 -1
  14. package/lib/types/asyncapi3.js +228 -47
  15. package/lib/types/asyncapi3.js.map +1 -1
  16. package/lib/types/index.d.ts +18 -2
  17. package/lib/types/index.d.ts.map +1 -1
  18. package/lib/types/index.js +4 -2
  19. package/lib/types/index.js.map +1 -1
  20. package/lib/types/oas2.d.ts +22 -0
  21. package/lib/types/oas2.d.ts.map +1 -1
  22. package/lib/types/oas3.d.ts +44 -0
  23. package/lib/types/oas3.d.ts.map +1 -1
  24. package/lib/types/oas3.js +345 -70
  25. package/lib/types/oas3.js.map +1 -1
  26. package/lib/types/oas3_1.d.ts +46 -0
  27. package/lib/types/oas3_1.d.ts.map +1 -1
  28. package/lib/types/oas3_1.js +38 -29
  29. package/lib/types/oas3_1.js.map +1 -1
  30. package/lib/types/oas3_2.d.ts +46 -0
  31. package/lib/types/oas3_2.d.ts.map +1 -1
  32. package/lib/types/oas3_2.js +101 -23
  33. package/lib/types/oas3_2.js.map +1 -1
  34. package/lib/types/openrpc.d.ts +32 -0
  35. package/lib/types/openrpc.d.ts.map +1 -1
  36. package/lib/types/openrpc.js +215 -46
  37. package/lib/types/openrpc.js.map +1 -1
  38. package/lib/types/overlay.d.ts.map +1 -1
  39. package/lib/types/overlay.js +34 -7
  40. package/lib/types/overlay.js.map +1 -1
  41. package/lib/types/redocly-yaml.d.ts +1 -1
  42. package/lib/types/redocly-yaml.d.ts.map +1 -1
  43. package/lib/types/redocly-yaml.js +150 -38
  44. package/lib/types/redocly-yaml.js.map +1 -1
  45. package/package.json +1 -1
package/lib/types/oas3.js CHANGED
@@ -17,70 +17,129 @@ const Root = {
17
17
  },
18
18
  required: ['openapi', 'paths', 'info'],
19
19
  extensionsPrefix: 'x-',
20
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/openapi#openapi',
21
+ description: 'REQUIRED. This string MUST be the semantic version number of the OpenAPI Specification version that the OpenAPI document uses. The openapi field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is not related to the API info.version string.',
20
22
  };
21
23
  const Tag = {
22
24
  properties: {
23
- name: { type: 'string' },
24
- description: { type: 'string' },
25
+ name: {
26
+ type: 'string',
27
+ description: 'REQUIRED. The name of the tag.',
28
+ },
29
+ description: {
30
+ type: 'string',
31
+ description: 'A description for the tag.',
32
+ },
25
33
  externalDocs: 'ExternalDocs',
26
34
  'x-traitTag': { type: 'boolean' },
27
35
  'x-displayName': { type: 'string' },
28
36
  },
29
37
  required: ['name'],
30
38
  extensionsPrefix: 'x-',
39
+ description: `The Tag Object represents a tag used by the OAS. It is not mandatory to have a tag object per tag used by the OAS but each tag object can contain additional metadata.`,
40
+ documentationLink: `https://spec.openapis.org/oas/v3.1.0#tag-object`,
31
41
  };
32
42
  const TagGroup = {
33
43
  properties: {
34
- name: { type: 'string' },
35
- tags: { type: 'array', items: { type: 'string' } },
44
+ name: {
45
+ type: 'string',
46
+ description: 'The display name for the tag, used in the navigation bar and as a section heading.',
47
+ },
48
+ tags: {
49
+ type: 'array',
50
+ description: 'List of tags to include in this group.',
51
+ items: { type: 'string' },
52
+ },
36
53
  },
37
54
  extensionsPrefix: 'x-',
55
+ description: 'The x-tagGroups extension is used at the top level of an OpenAPI description.',
56
+ documentationLink: 'https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-tag-groups#taggroup-object',
38
57
  };
39
58
  const ExternalDocs = {
40
59
  properties: {
41
- description: { type: 'string' },
42
- url: { type: 'string' },
60
+ description: {
61
+ type: 'string',
62
+ description: 'A description of the target documentation. Used as the link anchor text in Redocly. If not provided, the url is used as the link anchor text.',
63
+ },
64
+ url: {
65
+ type: 'string',
66
+ description: 'REQUIRED. The URL for the target documentation.',
67
+ },
43
68
  },
44
69
  required: ['url'],
45
70
  extensionsPrefix: 'x-',
71
+ description: 'Additional external documentation for this operation.',
72
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/external-docs',
46
73
  };
47
74
  const Server = {
48
75
  properties: {
49
- url: { type: 'string' },
50
- description: { type: 'string' },
76
+ url: {
77
+ type: 'string',
78
+ description: 'REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions are made when a variable is named in { curly braces }.',
79
+ },
80
+ description: {
81
+ type: 'string',
82
+ description: 'An optional string describing the host designated by the URL.',
83
+ },
51
84
  variables: 'ServerVariablesMap',
52
85
  },
53
86
  required: ['url'],
54
87
  extensionsPrefix: 'x-',
88
+ description: 'A server object to be used by the target operation.',
55
89
  };
56
90
  const ServerVariable = {
57
91
  properties: {
58
92
  enum: {
59
93
  type: 'array',
60
94
  items: { type: 'string' },
95
+ description: 'An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty. If defined, the array MUST contain the default value.',
96
+ },
97
+ default: {
98
+ type: 'string',
99
+ description: `REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value is not supplied. Note this behavior is different than the Schema Object's treatment of default values, because in those cases parameter values are optional. If the enum is defined, the value MUST exist in the enum's values.`,
100
+ },
101
+ description: {
102
+ type: 'string',
103
+ description: 'An optional description for the server variable.',
61
104
  },
62
- default: { type: 'string' },
63
- description: { type: 'string' },
64
105
  },
65
106
  required: ['default'],
66
107
  extensionsPrefix: 'x-',
108
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/server-variables#server-variables',
109
+ description: 'Server variables are used when you need to make a substitution into the server URL such as when the subdomain is unique per tenant.',
67
110
  };
68
111
  const SecurityRequirement = {
69
112
  properties: {},
70
113
  additionalProperties: { type: 'array', items: { type: 'string' } },
114
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/security#security-requirement-object',
115
+ description: 'A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition. To make security optional, an empty security requirement ({}) can be included in the array.',
71
116
  };
72
117
  const Info = {
73
118
  properties: {
74
- title: { type: 'string' },
75
- version: { type: 'string' },
76
- description: { type: 'string' },
77
- termsOfService: { type: 'string' },
119
+ title: {
120
+ type: 'string',
121
+ description: 'REQUIRED. The title of the API.',
122
+ },
123
+ version: {
124
+ type: 'string',
125
+ description: 'REQUIRED. The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version).',
126
+ },
127
+ description: {
128
+ type: 'string',
129
+ description: 'RECOMMENDED. A description of the API (Markdown may be used).',
130
+ },
131
+ termsOfService: {
132
+ type: 'string',
133
+ description: 'A URL to the Terms of Service for the API.',
134
+ },
78
135
  contact: 'Contact',
79
136
  license: 'License',
80
137
  'x-logo': 'Logo',
81
138
  },
82
139
  required: ['title', 'version'],
83
140
  extensionsPrefix: 'x-',
141
+ description: 'REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required.',
142
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/info#info',
84
143
  };
85
144
  const Logo = {
86
145
  properties: {
@@ -89,38 +148,72 @@ const Logo = {
89
148
  backgroundColor: { type: 'string' },
90
149
  href: { type: 'string' },
91
150
  },
151
+ documentationLink: 'https://redocly.com/docs-legacy/api-reference-docs/specification-extensions/x-logo#x-logo',
152
+ description: 'A commonly used specification extension containing the information about the API logo.',
92
153
  };
93
154
  const Contact = {
94
155
  properties: {
95
- name: { type: 'string' },
96
- url: { type: 'string' },
97
- email: { type: 'string' },
156
+ name: {
157
+ type: 'string',
158
+ description: 'The identifying name of the contact person or organization.',
159
+ },
160
+ url: {
161
+ type: 'string',
162
+ description: 'The URL pointing to the contact information.',
163
+ },
164
+ email: {
165
+ type: 'string',
166
+ description: 'The email address of the contact person or organization.',
167
+ },
98
168
  },
99
169
  extensionsPrefix: 'x-',
170
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/contact',
171
+ description: 'The contact information for the exposed API.',
100
172
  };
101
173
  const License = {
102
174
  properties: {
103
- name: { type: 'string' },
104
- url: { type: 'string' },
175
+ name: {
176
+ type: 'string',
177
+ description: 'REQUIRED. The license name used for the API.',
178
+ },
179
+ url: {
180
+ type: 'string',
181
+ description: 'The URL pointing to the contact information.',
182
+ },
105
183
  },
106
184
  required: ['name'],
107
185
  extensionsPrefix: 'x-',
186
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/license#license',
187
+ description: 'The license information for the exposed API.',
108
188
  };
109
189
  const Paths = {
110
190
  properties: {},
111
191
  additionalProperties: (_value, key) => key.startsWith('/') ? 'PathItem' : undefined,
192
+ description: 'The Paths Object is a map of a paths to the path item object. A path starts with a /.',
193
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/paths#paths-object',
112
194
  };
113
195
  const WebhooksMap = {
114
196
  properties: {},
115
197
  additionalProperties: () => 'PathItem',
198
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/webhooks#types',
116
199
  };
117
200
  const PathItem = {
118
201
  properties: {
119
- $ref: { type: 'string' }, // TODO: verify special $ref handling for Path Item
202
+ $ref: {
203
+ type: 'string',
204
+ description: 'Allows for a referenced definition of this path item. The referenced structure MUST be in the form of a Path Item Object. In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined. See the rules for resolving Relative References.',
205
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/reference',
206
+ }, // TODO: verify special $ref handling for Path Item
120
207
  servers: 'ServerList',
121
208
  parameters: 'ParameterList',
122
- summary: { type: 'string' },
123
- description: { type: 'string' },
209
+ summary: {
210
+ type: 'string',
211
+ description: 'An optional, string summary, intended to apply to all operations in this path.',
212
+ },
213
+ description: {
214
+ type: 'string',
215
+ description: 'An optional, string description, intended to apply to all operations in this path.',
216
+ },
124
217
  get: 'Operation',
125
218
  put: 'Operation',
126
219
  post: 'Operation',
@@ -132,20 +225,47 @@ const PathItem = {
132
225
  'x-query': 'Operation',
133
226
  },
134
227
  extensionsPrefix: 'x-',
228
+ description: 'Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.',
229
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/path-item#path-item-object',
135
230
  };
136
231
  const Parameter = {
137
232
  properties: {
138
- name: { type: 'string' },
139
- in: { enum: ['query', 'header', 'path', 'cookie'] },
140
- description: { type: 'string' },
141
- required: { type: 'boolean' },
142
- deprecated: { type: 'boolean' },
143
- allowEmptyValue: { type: 'boolean' },
233
+ name: {
234
+ type: 'string',
235
+ description: 'REQUIRED. The name of the parameter. Parameter names are case sensitive.',
236
+ },
237
+ in: {
238
+ enum: ['query', 'header', 'path', 'cookie'],
239
+ description: 'REQUIRED. The location of the parameter. Possible values are "query", "header", "path", or "cookie".',
240
+ },
241
+ description: {
242
+ type: 'string',
243
+ description: 'A brief description of the parameter. This could contain examples of use.',
244
+ },
245
+ required: {
246
+ type: 'boolean',
247
+ description: 'Determines whether this parameter is mandatory. If the parameter location is "path", this property is REQUIRED and its value MUST be true. Otherwise, the property MAY be included and its default value is false.',
248
+ },
249
+ deprecated: {
250
+ type: 'boolean',
251
+ description: 'Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is false.',
252
+ },
253
+ allowEmptyValue: {
254
+ type: 'boolean',
255
+ description: 'Sets the ability to pass empty-valued parameters. This is valid only for query parameters and allows sending a parameter with an empty value. Default value is false. If style is used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL be ignored. Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision.',
256
+ },
144
257
  style: {
145
258
  enum: ['form', 'simple', 'label', 'matrix', 'spaceDelimited', 'pipeDelimited', 'deepObject'],
259
+ description: 'Describes how the parameter value will be serialized depending on the type of the parameter value. Default values (based on value of in): for query - form; for path - simple; for header - simple; for cookie - form.',
260
+ },
261
+ explode: {
262
+ type: 'boolean',
263
+ description: 'When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map. For other types of parameters this property has no effect. When style is form, the default value is true. For all other styles, the default value is false.',
264
+ },
265
+ allowReserved: {
266
+ type: 'boolean',
267
+ description: `Determines whether the parameter value SHOULD allow reserved characters, as defined by RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding. This property only applies to parameters with an in value of query. The default value is false.`,
146
268
  },
147
- explode: { type: 'boolean' },
148
- allowReserved: { type: 'boolean' },
149
269
  schema: 'Schema',
150
270
  example: { isExample: true },
151
271
  examples: 'ExamplesMap',
@@ -154,17 +274,32 @@ const Parameter = {
154
274
  required: ['name', 'in'],
155
275
  requiredOneOf: ['schema', 'content'],
156
276
  extensionsPrefix: 'x-',
277
+ description: 'Describes a request parameter, which excludes the request body. A unique parameter is defined by a unique combination of the name and in values.',
278
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/parameter',
157
279
  };
158
280
  const Operation = {
159
281
  properties: {
160
282
  tags: {
161
283
  type: 'array',
162
284
  items: { type: 'string' },
285
+ description: 'A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.',
286
+ },
287
+ summary: {
288
+ type: 'string',
289
+ description: 'A short summary of what the operation does.',
290
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/operation#summary',
291
+ },
292
+ description: {
293
+ type: 'string',
294
+ description: 'A verbose explanation of the operation behavior.',
295
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/operation#description',
163
296
  },
164
- summary: { type: 'string' },
165
- description: { type: 'string' },
166
297
  externalDocs: 'ExternalDocs',
167
- operationId: { type: 'string' },
298
+ operationId: {
299
+ type: 'string',
300
+ description: 'The operationId is path segment or path fragment in deep links to a specific operation.',
301
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/operation#operationid',
302
+ },
168
303
  parameters: 'ParameterList',
169
304
  security: 'SecurityRequirementList',
170
305
  servers: 'ServerList',
@@ -178,6 +313,8 @@ const Operation = {
178
313
  },
179
314
  required: ['responses'],
180
315
  extensionsPrefix: 'x-',
316
+ description: `The Operation Object describes a single API operation on a path, including its parameters, responses, and request body (if applicable). Each path can support more than one operation, but those operations must be unique. A unique operation is a combination of a path and an HTTP method, so two GET or two POST methods for the same path are not allowed.`,
317
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/operation',
181
318
  };
182
319
  const XCodeSample = {
183
320
  properties: {
@@ -185,76 +322,130 @@ const XCodeSample = {
185
322
  label: { type: 'string' },
186
323
  source: { type: 'string' },
187
324
  },
325
+ documentationLink: 'https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-code-samples',
326
+ description: 'Code samples are snippets of code shown alongside API operations in reference documentation, giving users a quick way to start to interact with an API from their own code. The x-codeSamples addition to OpenAPI allows you to add or override any existing code samples for a particular language or endpoint.',
188
327
  };
189
328
  const RequestBody = {
190
329
  properties: {
191
- description: { type: 'string' },
192
- required: { type: 'boolean' },
330
+ description: {
331
+ type: 'string',
332
+ description: 'A brief description of the request body. This could contain examples of use.',
333
+ },
334
+ required: {
335
+ type: 'boolean',
336
+ description: 'Determines if the request body is required in the request. Defaults to false.',
337
+ },
193
338
  content: 'MediaTypesMap',
194
339
  },
195
340
  required: ['content'],
196
341
  extensionsPrefix: 'x-',
342
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/request-body',
343
+ description: 'The request body is defined inside of operations (including paths and webhooks). The request body can also be defined inside of the named requestBodies object in components.',
197
344
  };
198
345
  const MediaTypesMap = {
199
346
  properties: {},
200
347
  additionalProperties: 'MediaType',
348
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/media-type#types',
201
349
  };
202
350
  const MediaType = {
203
351
  properties: {
204
352
  schema: 'Schema',
205
- example: { isExample: true },
353
+ example: {
354
+ isExample: true,
355
+ description: 'Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The example field is mutually exclusive of the examples field. Furthermore, if referencing a schema which contains an example, the example value SHALL override the example provided by the schema.',
356
+ },
206
357
  examples: 'ExamplesMap',
207
358
  encoding: 'EncodingMap',
208
359
  },
209
360
  extensionsPrefix: 'x-',
361
+ description: 'The Media Type Object is one of the important building blocks of OpenAPI.',
362
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/media-type',
210
363
  };
211
364
  const Example = {
212
365
  properties: {
213
- value: { resolvable: false },
366
+ value: {
367
+ resolvable: false,
368
+ description: 'Embedded literal example. The value field and externalValue field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON or YAML, use a string value to contain the example, escaping where necessary.',
369
+ },
214
370
  summary: { type: 'string' },
215
- description: { type: 'string' },
216
- externalValue: { type: 'string' },
371
+ description: { type: 'string', description: 'Long description for the example.' },
372
+ externalValue: {
373
+ type: 'string',
374
+ description: 'A URL that points to the literal example. This provides the capability to reference examples that cannot easily be included in JSON or YAML documents. The value field and externalValue field are mutually exclusive.',
375
+ },
217
376
  },
218
377
  extensionsPrefix: 'x-',
378
+ description: 'Example of the media type. The example object SHOULD be in the correct format as specified by the media type. The example field is mutually exclusive of the examples field. Furthermore, if referencing a schema which contains an example, the example value SHALL override the example provided by the schema.',
379
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/example',
219
380
  };
220
381
  const Encoding = {
221
382
  properties: {
222
- contentType: { type: 'string' },
383
+ contentType: {
384
+ type: 'string',
385
+ description: `The Content-Type for encoding a specific property. Default value depends on the property type: for string with format being binary – application/octet-stream; for other primitive types – text/plain; for object - application/json; for array – the default is defined based on the inner type. The value can be a specific media type (e.g. application/json), a wildcard media type (e.g. image/*), or a comma-separated list of the two types.`,
386
+ },
223
387
  headers: 'HeadersMap',
224
388
  style: {
225
389
  enum: ['form', 'simple', 'label', 'matrix', 'spaceDelimited', 'pipeDelimited', 'deepObject'],
390
+ description: 'Describes how a specific property value will be serialized depending on its type. See Parameter Object for details on the style property. The behavior follows the same values as query parameters, including default values. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded.',
391
+ },
392
+ explode: {
393
+ type: 'boolean',
394
+ description: 'When this is true, property values of type array or object generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. When style is form, the default value is true. For all other styles, the default value is false. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded.',
395
+ },
396
+ allowReserved: {
397
+ type: 'boolean',
398
+ description: `Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986] Section 2.2 :/?#[]@!$&'()*+,;= to be included without percent-encoding. The default value is false. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded.`,
226
399
  },
227
- explode: { type: 'boolean' },
228
- allowReserved: { type: 'boolean' },
229
400
  },
230
401
  extensionsPrefix: 'x-',
402
+ description: 'A single encoding definition applied to a single schema property.',
403
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/encoding#types',
231
404
  };
232
405
  const EnumDescriptions = {
233
406
  properties: {},
234
407
  additionalProperties: { type: 'string' },
408
+ description: 'The enum (short for "enumeration") fields in OpenAPI allow you to restrict the value of a field to a list of allowed values. These values need to be short and machine-readable, but that can make them harder for humans to parse and work with.',
409
+ documentationLink: 'https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-enum-descriptions',
235
410
  };
236
411
  const Header = {
237
412
  properties: {
238
- description: { type: 'string' },
239
- required: { type: 'boolean' },
413
+ description: {
414
+ type: 'string',
415
+ description: 'A brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.',
416
+ },
417
+ required: {
418
+ type: 'boolean',
419
+ description: 'Determines whether this parameter is mandatory. Its default value is false.',
420
+ },
240
421
  deprecated: { type: 'boolean' },
241
- allowEmptyValue: { type: 'boolean' },
422
+ allowEmptyValue: {
423
+ type: 'boolean',
424
+ description: 'Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value is false.',
425
+ },
242
426
  style: {
243
427
  enum: ['form', 'simple', 'label', 'matrix', 'spaceDelimited', 'pipeDelimited', 'deepObject'],
244
428
  },
245
429
  explode: { type: 'boolean' },
246
430
  allowReserved: { type: 'boolean' },
247
431
  schema: 'Schema',
248
- example: { isExample: true },
432
+ example: {
433
+ isExample: true,
434
+ description: `Example of the header's potential value. The example SHOULD match the specified schema and encoding properties if present. The example field is mutually exclusive of the examples field. Furthermore, if referencing a schema that contains an example, the example value SHALL override the example provided by the schema. To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.`,
435
+ },
249
436
  examples: 'ExamplesMap',
250
437
  content: 'MediaTypesMap',
251
438
  },
252
439
  requiredOneOf: ['schema', 'content'],
253
440
  extensionsPrefix: 'x-',
441
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/header#header-object',
442
+ description: 'The header object is used to describe a response header in the headers map.',
254
443
  };
255
444
  const Responses = {
256
445
  properties: { default: 'Response' },
257
446
  additionalProperties: (_v, key) => responseCodeRegexp.test(key) ? 'Response' : undefined,
447
+ description: 'The list of possible responses as they are returned from executing this operation.',
448
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/named-responses',
258
449
  };
259
450
  const Response = {
260
451
  properties: {
@@ -262,28 +453,45 @@ const Response = {
262
453
  headers: 'HeadersMap',
263
454
  content: 'MediaTypesMap',
264
455
  links: 'LinksMap',
265
- 'x-summary': { type: 'string' },
456
+ 'x-summary': {
457
+ type: 'string',
458
+ documentationLink: 'https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-summary#openapi-extension-x-summary',
459
+ description: 'Use x-summary to add a short custom text to describe the response in the API documentation.',
460
+ },
266
461
  },
267
462
  required: ['description'],
268
463
  extensionsPrefix: 'x-',
464
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/response',
465
+ description: 'The response object describes a single response in the Responses Map.',
269
466
  };
270
467
  const Link = {
271
468
  properties: {
272
- operationRef: { type: 'string' },
273
- operationId: { type: 'string' },
469
+ operationRef: {
470
+ type: 'string',
471
+ description: 'A relative or absolute reference to an OAS operation. This field is mutually exclusive of the operationId field, and MUST point to an Operation Object. Relative operationRef values MAY be used to locate an existing Operation Object in the OpenAPI definition.',
472
+ },
473
+ operationId: {
474
+ type: 'string',
475
+ description: 'The name of an existing, resolvable OAS operation, as defined with a unique operationId. This field is mutually exclusive of the operationRef field.',
476
+ },
274
477
  parameters: null, // TODO: figure out how to describe/validate this
275
478
  requestBody: null, // TODO: figure out how to describe/validate this
276
- description: { type: 'string' },
479
+ description: { type: 'string', description: 'A description of the link.' },
277
480
  server: 'Server',
278
481
  },
279
482
  extensionsPrefix: 'x-',
483
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/links',
484
+ description: 'The Link object represents a possible design-time link for a response. The presence of a link does not guarantee the caller’s ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.',
280
485
  };
281
486
  // draft-00
282
487
  const Schema = {
283
488
  properties: {
284
489
  externalDocs: 'ExternalDocs',
285
490
  discriminator: 'Discriminator',
286
- title: { type: 'string' },
491
+ title: {
492
+ type: 'string',
493
+ description: 'Value MUST be a string. Multiple types via an array are not supported.',
494
+ },
287
495
  multipleOf: { type: 'number', minimum: 0 },
288
496
  maximum: { type: 'number' },
289
497
  minimum: { type: 'number' },
@@ -291,7 +499,10 @@ const Schema = {
291
499
  exclusiveMinimum: { type: 'boolean' },
292
500
  maxLength: { type: 'integer', minimum: 0 },
293
501
  minLength: { type: 'integer', minimum: 0 },
294
- pattern: { type: 'string' },
502
+ pattern: {
503
+ type: 'string',
504
+ description: '(This string SHOULD be a valid regular expression, according to the Ecma-262 Edition 5.1 regular expression dialect)',
505
+ },
295
506
  maxItems: { type: 'integer', minimum: 0 },
296
507
  minItems: { type: 'integer', minimum: 0 },
297
508
  uniqueItems: { type: 'boolean' },
@@ -301,10 +512,17 @@ const Schema = {
301
512
  enum: { type: 'array' },
302
513
  type: {
303
514
  enum: ['object', 'array', 'string', 'number', 'integer', 'boolean'],
515
+ description: 'Value MUST be a string. Multiple types via an array are not supported.',
304
516
  },
305
- allOf: listOf('Schema'),
306
- anyOf: listOf('Schema'),
307
- oneOf: listOf('Schema'),
517
+ allOf: listOf('Schema', {
518
+ description: 'Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema.',
519
+ }),
520
+ anyOf: listOf('Schema', {
521
+ description: 'Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema.',
522
+ }),
523
+ oneOf: listOf('Schema', {
524
+ description: 'Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema.',
525
+ }),
308
526
  not: 'Schema',
309
527
  properties: 'SchemaProperties',
310
528
  items: (value) => {
@@ -323,8 +541,14 @@ const Schema = {
323
541
  return 'Schema';
324
542
  }
325
543
  },
326
- description: { type: 'string' },
327
- format: { type: 'string' },
544
+ description: {
545
+ type: 'string',
546
+ description: 'CommonMark syntax MAY be used for rich text representation.',
547
+ },
548
+ format: {
549
+ type: 'string',
550
+ description: `See Data Type Formats for further details. While relying on JSON Schema's defined formats, the OAS offers a few additional predefined formats.`,
551
+ },
328
552
  default: null,
329
553
  nullable: { type: 'boolean' },
330
554
  readOnly: { type: 'boolean' },
@@ -337,6 +561,8 @@ const Schema = {
337
561
  'x-explicitMappingOnly': { type: 'boolean' },
338
562
  },
339
563
  extensionsPrefix: 'x-',
564
+ description: 'The schema defining the content of the request, response, or parameter.',
565
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/schemas',
340
566
  };
341
567
  const Xml = {
342
568
  properties: {
@@ -347,6 +573,7 @@ const Xml = {
347
573
  wrapped: { type: 'boolean' },
348
574
  },
349
575
  extensionsPrefix: 'x-',
576
+ description: 'This MAY be used only on properties schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property.',
350
577
  };
351
578
  const SchemaProperties = {
352
579
  properties: {},
@@ -362,14 +589,20 @@ const DiscriminatorMapping = {
362
589
  return { type: 'string' };
363
590
  }
364
591
  },
592
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/discriminator#types',
365
593
  };
366
594
  const Discriminator = {
367
595
  properties: {
368
- propertyName: { type: 'string' },
596
+ propertyName: {
597
+ type: 'string',
598
+ description: 'REQUIRED. The name of the property in the payload that will hold the discriminator value.',
599
+ },
369
600
  mapping: 'DiscriminatorMapping',
370
601
  },
371
602
  required: ['propertyName'],
372
603
  extensionsPrefix: 'x-',
604
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/discriminator#discriminator-object',
605
+ description: 'When request bodies or response payloads may be one of a number of different schemas, a discriminator object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the document of an alternative schema based on the value associated with it.',
373
606
  };
374
607
  const Components = {
375
608
  properties: {
@@ -384,6 +617,7 @@ const Components = {
384
617
  callbacks: 'NamedCallbacks',
385
618
  },
386
619
  extensionsPrefix: 'x-',
620
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/components#components',
387
621
  };
388
622
  const ImplicitFlow = {
389
623
  properties: {
@@ -393,6 +627,7 @@ const ImplicitFlow = {
393
627
  },
394
628
  required: ['authorizationUrl', 'scopes'],
395
629
  extensionsPrefix: 'x-',
630
+ description: 'Configuration for the OAuth Implicit flow.',
396
631
  };
397
632
  const PasswordFlow = {
398
633
  properties: {
@@ -402,6 +637,7 @@ const PasswordFlow = {
402
637
  },
403
638
  required: ['tokenUrl', 'scopes'],
404
639
  extensionsPrefix: 'x-',
640
+ description: 'Object Configuration for the OAuth Resource Owner Password flow.',
405
641
  };
406
642
  const ClientCredentials = {
407
643
  properties: {
@@ -411,6 +647,7 @@ const ClientCredentials = {
411
647
  },
412
648
  required: ['tokenUrl', 'scopes'],
413
649
  extensionsPrefix: 'x-',
650
+ description: 'Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0.',
414
651
  };
415
652
  const AuthorizationCode = {
416
653
  properties: {
@@ -429,6 +666,7 @@ const AuthorizationCode = {
429
666
  },
430
667
  required: ['authorizationUrl', 'tokenUrl', 'scopes'],
431
668
  extensionsPrefix: 'x-',
669
+ description: 'Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.',
432
670
  };
433
671
  const OAuth2Flows = {
434
672
  properties: {
@@ -438,17 +676,40 @@ const OAuth2Flows = {
438
676
  authorizationCode: 'AuthorizationCode',
439
677
  },
440
678
  extensionsPrefix: 'x-',
679
+ description: 'Configuration details for a supported OAuth Flow.',
441
680
  };
442
681
  const SecurityScheme = {
443
682
  properties: {
444
- type: { enum: ['apiKey', 'http', 'oauth2', 'openIdConnect'] },
445
- description: { type: 'string' },
446
- name: { type: 'string' },
447
- in: { type: 'string', enum: ['query', 'header', 'cookie'] },
448
- scheme: { type: 'string' },
449
- bearerFormat: { type: 'string' },
683
+ type: {
684
+ enum: ['apiKey', 'http', 'oauth2', 'openIdConnect'],
685
+ description: 'REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "oauth2", "openIdConnect".',
686
+ },
687
+ description: {
688
+ type: 'string',
689
+ description: 'A short description for security scheme.',
690
+ },
691
+ name: {
692
+ type: 'string',
693
+ description: 'REQUIRED. The name of the header, query or cookie parameter to be used.',
694
+ },
695
+ in: {
696
+ type: 'string',
697
+ enum: ['query', 'header', 'cookie'],
698
+ description: 'REQUIRED. The location of the API key. Valid values are "query", "header" or "cookie".',
699
+ },
700
+ scheme: {
701
+ type: 'string',
702
+ description: 'A short description for security scheme.',
703
+ },
704
+ bearerFormat: {
705
+ type: 'string',
706
+ description: 'A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.',
707
+ },
450
708
  flows: 'OAuth2Flows',
451
- openIdConnectUrl: { type: 'string' },
709
+ openIdConnectUrl: {
710
+ type: 'string',
711
+ description: 'REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.',
712
+ },
452
713
  'x-defaultClientId': { type: 'string' },
453
714
  },
454
715
  required(value) {
@@ -486,18 +747,28 @@ const XUsePkce = {
486
747
  disableManualConfiguration: { type: 'boolean' },
487
748
  hideClientSecretInput: { type: 'boolean' },
488
749
  },
750
+ description: 'The x-usePkce allows you to enable Proof Key for Code Exchange (PKCE) for the Oauth2 or OpenID Connect authorization code flow in the Replay.',
751
+ documentationLink: 'https://redocly.com/docs/realm/content/api-docs/openapi-extensions/x-use-pkce#openapi-extension-x-usepkce',
489
752
  };
490
753
  export const Oas3Types = {
491
754
  Root,
492
755
  Tag,
493
- TagList: listOf('Tag'),
756
+ TagList: listOf('Tag', {
757
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/tags',
758
+ description: `A list of tags used by the document with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.`,
759
+ }),
494
760
  TagGroups: listOf('TagGroup'),
495
761
  TagGroup,
496
762
  ExternalDocs,
497
763
  Server,
498
- ServerList: listOf('Server'),
764
+ ServerList: listOf('Server', {
765
+ description: 'A list of servers available to the API.',
766
+ documentationLink: 'https://redocly.com/learn/openapi/openapi-visual-reference/servers#servers',
767
+ }),
499
768
  ServerVariable,
500
- ServerVariablesMap: mapOf('ServerVariable'),
769
+ ServerVariablesMap: mapOf('ServerVariable', {
770
+ description: `A map between a variable name and its value. The value is used for substitution in the server's URL template.`,
771
+ }),
501
772
  SecurityRequirement,
502
773
  SecurityRequirementList: listOf('SecurityRequirement'),
503
774
  Info,
@@ -506,9 +777,13 @@ export const Oas3Types = {
506
777
  Paths,
507
778
  PathItem,
508
779
  Parameter,
509
- ParameterList: listOf('Parameter'),
780
+ ParameterList: listOf('Parameter', {
781
+ description: 'A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object’s components/parameters.',
782
+ }),
510
783
  Operation,
511
- Callback: mapOf('PathItem'),
784
+ Callback: mapOf('PathItem', {
785
+ description: 'https://redocly.com/learn/openapi/openapi-visual-reference/callbacks#callback-object',
786
+ }),
512
787
  CallbacksMap: mapOf('Callback'),
513
788
  RequestBody,
514
789
  MediaTypesMap,