oas 17.2.0 → 17.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/lib/openapi-to-json-schema.d.ts +23 -20
- package/@types/operation/get-callback-examples.d.ts +2 -2
- package/@types/operation/get-parameters-as-json-schema.d.ts +21 -13
- package/@types/operation/get-requestbody-examples.d.ts +2 -2
- package/@types/operation/get-response-as-json-schema.d.ts +16 -4
- package/@types/operation/get-response-examples.d.ts +2 -2
- package/@types/operation.d.ts +75 -59
- package/@types/rmoas.types.d.ts +22 -0
- package/@types/utils.d.ts +2 -6
- package/CHANGELOG.md +6 -0
- package/dist/lib/openapi-to-json-schema.js +196 -156
- package/dist/operation/get-parameters-as-json-schema.js +116 -34
- package/dist/operation/get-response-as-json-schema.js +17 -9
- package/dist/operation.js +84 -39
- package/dist/rmoas.types.js +23 -1
- package/package.json +2 -1
- package/src/lib/{openapi-to-json-schema.js → openapi-to-json-schema.ts} +203 -164
- package/src/operation/get-callback-examples.ts +2 -2
- package/src/operation/{get-parameters-as-json-schema.js → get-parameters-as-json-schema.ts} +119 -45
- package/src/operation/get-requestbody-examples.ts +2 -2
- package/src/operation/{get-response-as-json-schema.js → get-response-as-json-schema.ts} +43 -19
- package/src/operation/get-response-examples.ts +2 -2
- package/src/operation.ts +100 -67
- package/src/rmoas.types.ts +37 -0
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import * as RMOAS from '../rmoas.types';
|
|
2
|
+
declare type PrevSchemasType = Array<RMOAS.SchemaObject>;
|
|
3
|
+
export declare type toJsonSchemaOptions = {
|
|
4
|
+
currentLocation?: string;
|
|
5
|
+
globalDefaults?: {
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
isPolymorphicAllOfChild?: boolean;
|
|
9
|
+
prevSchemas?: PrevSchemasType;
|
|
10
|
+
refLogger?: (ref: string) => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @param val
|
|
14
|
+
*/
|
|
15
|
+
export declare function isPrimitive(val: unknown): boolean;
|
|
2
16
|
/**
|
|
3
17
|
* Given an OpenAPI-flavored JSON Schema, make an effort to modify it so it's shaped more towards stock JSON Schema.
|
|
4
18
|
*
|
|
@@ -26,26 +40,15 @@ export = toJSONSchema;
|
|
|
26
40
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md}
|
|
27
41
|
* @param {Object} data
|
|
28
42
|
* @param {Object} opts
|
|
29
|
-
* @param {
|
|
43
|
+
* @param {string} opts.currentLocation - Current location within the schema -- this is a JSON pointer.
|
|
30
44
|
* @param {Object} opts.globalDefaults - Object containing a global set of defaults that we should apply to schemas that match it.
|
|
31
|
-
* @param {
|
|
45
|
+
* @param {boolean} opts.isPolymorphicAllOfChild - Is this schema the child of a polymorphic `allOf` schema?
|
|
32
46
|
* @param {Object[]} opts.prevSchemas - Array of parent schemas to utilize when attempting to path together examples.
|
|
33
47
|
* @param {Function} opts.refLogger - A function that's called anytime a (circular) `$ref` is found.
|
|
34
48
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}): {
|
|
42
|
-
constructor: Function;
|
|
43
|
-
toString(): string;
|
|
44
|
-
toLocaleString(): string;
|
|
45
|
-
valueOf(): Object;
|
|
46
|
-
hasOwnProperty(v: PropertyKey): boolean;
|
|
47
|
-
isPrototypeOf(v: Object): boolean;
|
|
48
|
-
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
49
|
-
} | {
|
|
50
|
-
$ref: any;
|
|
51
|
-
};
|
|
49
|
+
/**
|
|
50
|
+
* @param data
|
|
51
|
+
* @param opts
|
|
52
|
+
*/
|
|
53
|
+
export default function toJSONSchema(data: RMOAS.SchemaObject | RMOAS.RequestBodyObject, opts?: toJsonSchemaOptions): RMOAS.SchemaObject;
|
|
54
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type * as RMOAS from '../rmoas.types';
|
|
2
|
-
export declare type CallbackExamples = {
|
|
2
|
+
export declare type CallbackExamples = Array<{
|
|
3
3
|
identifier: string;
|
|
4
4
|
expression: string;
|
|
5
5
|
method: string;
|
|
6
6
|
example: unknown;
|
|
7
|
-
}
|
|
7
|
+
}>;
|
|
8
8
|
/**
|
|
9
9
|
* With an OpenAPI Operation Object return back an array of examples for any callbacks that may be present.
|
|
10
10
|
*
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
1
|
+
import type { OASDocument, OperationObject, SchemaObject } from '../rmoas.types';
|
|
2
|
+
import * as RMOAS from '../rmoas.types';
|
|
3
|
+
export declare type SchemaWrapper = {
|
|
4
|
+
$schema?: string;
|
|
5
|
+
type: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
schema: SchemaObject;
|
|
8
|
+
deprecatedProps?: SchemaWrapper;
|
|
9
|
+
};
|
|
10
|
+
export declare const types: {
|
|
11
|
+
[key: keyof RMOAS.OASDocument]: string;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: (path: string, operation: OperationObject, api: OASDocument, globalDefaults?: {}) => SchemaWrapper[];
|
|
14
|
+
/**
|
|
15
|
+
* @param {string} path
|
|
16
|
+
* @param {Operation} operation
|
|
17
|
+
* @param {OpenAPI.Document} api
|
|
18
|
+
* @param {Object} globalDefaults
|
|
19
|
+
* @returns {Array<object>}
|
|
20
|
+
*/
|
|
21
|
+
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type * as RMOAS from '../rmoas.types';
|
|
2
|
-
export declare type RequestBodyExamples = {
|
|
2
|
+
export declare type RequestBodyExamples = Array<{
|
|
3
3
|
mediaType: string;
|
|
4
4
|
examples: any;
|
|
5
|
-
}
|
|
5
|
+
}>;
|
|
6
6
|
/**
|
|
7
7
|
* @param operation Operation to retrieve requestBody examples for.
|
|
8
8
|
* @returns An object of response examples keyed by their media type.
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { OASDocument, SchemaObject } from 'rmoas.types';
|
|
2
|
+
import type Operation from 'operation';
|
|
3
|
+
/**
|
|
4
|
+
* Extract all the response schemas, matching the format of get-parameters-as-json-schema.
|
|
5
|
+
*
|
|
6
|
+
* Note: This expects a dereferenced schema.
|
|
7
|
+
*
|
|
8
|
+
* @param operation Operation to construct a response JSON Schema for.
|
|
9
|
+
* @param api The OpenAPI definition that this operation originates.
|
|
10
|
+
* @param statusCode The response status code to generate a schema for.
|
|
11
|
+
* @returns Array<{schema: Object, type: string, label: string}>
|
|
12
|
+
*/
|
|
13
|
+
export default function getResponseAsJsonSchema(operation: Operation, api: OASDocument, statusCode: string | number): {
|
|
14
|
+
type: string | Array<string>;
|
|
15
|
+
schema: SchemaObject;
|
|
4
16
|
label: string;
|
|
17
|
+
description?: string;
|
|
5
18
|
}[];
|
|
6
|
-
export = _exports;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type * as RMOAS from '../rmoas.types';
|
|
2
|
-
export declare type ResponseExamples = {
|
|
2
|
+
export declare type ResponseExamples = Array<{
|
|
3
3
|
status: string;
|
|
4
4
|
mediaTypes: Record<string, RMOAS.MediaTypeObject>;
|
|
5
|
-
}
|
|
5
|
+
}>;
|
|
6
6
|
/**
|
|
7
7
|
* @param operation Operation to retrieve response examples for.
|
|
8
8
|
* @returns An object of response examples keyed by their media type.
|
package/@types/operation.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import type * as RMOAS from './rmoas.types';
|
|
2
|
-
import type { OpenAPIV3, OpenAPIV3_1 } from 'openapi-types';
|
|
3
1
|
import type { RequestBodyExamples } from './operation/get-requestbody-examples';
|
|
4
2
|
import type { CallbackExamples } from './operation/get-callback-examples';
|
|
5
3
|
import type { ResponseExamples } from './operation/get-response-examples';
|
|
6
|
-
import
|
|
4
|
+
import * as RMOAS from './rmoas.types';
|
|
7
5
|
declare type SecurityType = 'Basic' | 'Bearer' | 'Query' | 'Header' | 'Cookie' | 'OAuth2' | 'http' | 'apiKey';
|
|
8
6
|
export default class Operation {
|
|
9
7
|
/**
|
|
10
|
-
* Schema of the operation from the API
|
|
8
|
+
* Schema of the operation from the API Definition.
|
|
11
9
|
*/
|
|
12
10
|
schema: RMOAS.OperationObject;
|
|
13
11
|
/**
|
|
@@ -45,7 +43,7 @@ export default class Operation {
|
|
|
45
43
|
request: Array<string>;
|
|
46
44
|
response: Array<string>;
|
|
47
45
|
};
|
|
48
|
-
constructor(api:
|
|
46
|
+
constructor(api: RMOAS.OASDocument, path: string, method: RMOAS.HttpMethods, operation: RMOAS.OperationObject);
|
|
49
47
|
getContentType(): string;
|
|
50
48
|
isFormUrlEncoded(): boolean;
|
|
51
49
|
isMultipart(): boolean;
|
|
@@ -55,105 +53,114 @@ export default class Operation {
|
|
|
55
53
|
* Returns an array of all security requirements associated wtih this operation. If none are defined at the operation
|
|
56
54
|
* level, the securities for the entire API definition are returned (with an empty array as a final fallback).
|
|
57
55
|
*
|
|
58
|
-
* @returns Array
|
|
56
|
+
* @returns {Array}
|
|
59
57
|
*/
|
|
60
|
-
getSecurity():
|
|
58
|
+
getSecurity(): Array<RMOAS.SecurityRequirementObject>;
|
|
61
59
|
/**
|
|
62
60
|
* @see {@link https://swagger.io/docs/specification/authentication/#multiple}
|
|
63
61
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-requirement-object}
|
|
64
|
-
* @param filterInvalid Optional flag that, when set to `true`, filters out invalid/nonexistent security
|
|
65
|
-
* rather than returning `false`.
|
|
66
|
-
* @returns An array of arrays of objects of grouped security schemes. The inner array determines and-grouped
|
|
62
|
+
* @param {boolean} filterInvalid Optional flag that, when set to `true`, filters out invalid/nonexistent security
|
|
63
|
+
* schemes, rather than returning `false`.
|
|
64
|
+
* @returns {Array} An array of arrays of objects of grouped security schemes. The inner array determines and-grouped
|
|
67
65
|
* security schemes, the outer array determines or-groups.
|
|
68
66
|
*/
|
|
69
|
-
getSecurityWithTypes(filterInvalid?: boolean):
|
|
67
|
+
getSecurityWithTypes(filterInvalid?: boolean): Array<false | Array<false | {
|
|
68
|
+
security: RMOAS.KeyedSecuritySchemeObject;
|
|
70
69
|
type: SecurityType;
|
|
71
|
-
|
|
72
|
-
_key: string;
|
|
73
|
-
'x-default'?: string | number;
|
|
74
|
-
} & OpenAPIV3.HttpSecurityScheme) | ({
|
|
75
|
-
_key: string;
|
|
76
|
-
'x-default'?: string | number;
|
|
77
|
-
} & OpenAPIV3.ApiKeySecurityScheme) | ({
|
|
78
|
-
_key: string;
|
|
79
|
-
'x-default'?: string | number;
|
|
80
|
-
} & OpenAPIV3.OAuth2SecurityScheme);
|
|
81
|
-
})[])[];
|
|
70
|
+
}>>;
|
|
82
71
|
/**
|
|
83
72
|
* @returns An object where the keys are unique scheme types, and the values are arrays containing each security
|
|
84
73
|
* scheme of that type.
|
|
85
74
|
*/
|
|
86
|
-
prepareSecurity(): Record<SecurityType, RMOAS.KeyedSecuritySchemeObject
|
|
87
|
-
getHeaders():
|
|
88
|
-
request: string[];
|
|
89
|
-
response: string[];
|
|
90
|
-
};
|
|
75
|
+
prepareSecurity(): Record<SecurityType, Array<RMOAS.KeyedSecuritySchemeObject>>;
|
|
76
|
+
getHeaders(): Operation['headers'];
|
|
91
77
|
/**
|
|
92
|
-
*
|
|
78
|
+
* Determine if the operation has an operation present in its schema.
|
|
79
|
+
*
|
|
80
|
+
* @returns {boolean}
|
|
93
81
|
*/
|
|
94
82
|
hasOperationId(): boolean;
|
|
95
83
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
84
|
+
* Get an `operationId` for this operation. If one is not present (it's not required by the spec!) a hash of the path
|
|
85
|
+
* and method will be returned instead.
|
|
98
86
|
*
|
|
99
|
-
* @returns
|
|
87
|
+
* @returns {string}
|
|
100
88
|
*/
|
|
101
89
|
getOperationId(): string;
|
|
102
90
|
/**
|
|
103
|
-
*
|
|
91
|
+
* Return an array of all tags, and their metadata, that exist on this operation.
|
|
92
|
+
*
|
|
93
|
+
* @returns {Array}
|
|
104
94
|
*/
|
|
105
|
-
getTags():
|
|
95
|
+
getTags(): Array<RMOAS.TagObject>;
|
|
106
96
|
/**
|
|
107
|
-
*
|
|
97
|
+
* Return is the operation is flagged as `deprecated` or not.
|
|
98
|
+
*
|
|
99
|
+
* @returns {boolean}
|
|
108
100
|
*/
|
|
109
101
|
isDeprecated(): boolean;
|
|
110
102
|
/**
|
|
103
|
+
* Return the parameters (non-request body) on the operation.
|
|
104
|
+
*
|
|
111
105
|
* @todo This should also pull in common params.
|
|
112
|
-
* @returns
|
|
106
|
+
* @returns {Array}
|
|
113
107
|
*/
|
|
114
|
-
getParameters():
|
|
108
|
+
getParameters(): Array<RMOAS.ParameterObject>;
|
|
115
109
|
/**
|
|
116
110
|
* Convert the operation into an array of JSON Schema for each available type of parameter available on the operation.
|
|
117
|
-
* `globalDefaults` contains an object of user defined parameter defaults used
|
|
111
|
+
* `globalDefaults` contains an object of user defined parameter defaults used in `constructSchema`.
|
|
118
112
|
*
|
|
119
|
-
* @param globalDefaults
|
|
120
|
-
* @returns
|
|
113
|
+
* @param {Object} globalDefaults
|
|
114
|
+
* @returns {Array}
|
|
121
115
|
*/
|
|
122
|
-
getParametersAsJsonSchema(globalDefaults?: unknown):
|
|
116
|
+
getParametersAsJsonSchema(globalDefaults?: unknown): import("./operation/get-parameters-as-json-schema").SchemaWrapper[];
|
|
123
117
|
/**
|
|
124
118
|
* Get a single response for this status code, formatted as JSON schema.
|
|
125
119
|
*
|
|
126
|
-
* @param statusCode
|
|
127
|
-
* @returns
|
|
120
|
+
* @param {string|number} statusCode
|
|
121
|
+
* @returns {Array}
|
|
128
122
|
*/
|
|
129
123
|
getResponseAsJsonSchema(statusCode: string): {
|
|
130
|
-
type:
|
|
131
|
-
schema:
|
|
124
|
+
type: string | string[];
|
|
125
|
+
schema: RMOAS.SchemaObject;
|
|
132
126
|
label: string;
|
|
127
|
+
description?: string;
|
|
133
128
|
}[];
|
|
134
129
|
/**
|
|
135
|
-
*
|
|
130
|
+
* Get an array of all valid response status codes for this operation.
|
|
131
|
+
*
|
|
132
|
+
* @returns {Array}
|
|
136
133
|
*/
|
|
137
|
-
getResponseStatusCodes(): string
|
|
134
|
+
getResponseStatusCodes(): Array<string>;
|
|
138
135
|
/**
|
|
139
|
-
*
|
|
136
|
+
* Determine if the operation has a request body.
|
|
137
|
+
*
|
|
138
|
+
* @returns {boolean}
|
|
140
139
|
*/
|
|
141
140
|
hasRequestBody(): boolean;
|
|
142
141
|
/**
|
|
143
|
-
*
|
|
142
|
+
* Retrieve an array of request body examples that this operation has.
|
|
143
|
+
*
|
|
144
|
+
* @returns {Array}
|
|
144
145
|
*/
|
|
145
146
|
getRequestBodyExamples(): RequestBodyExamples;
|
|
146
147
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
148
|
+
* Return a specific response out of the operation by a given HTTP status code.
|
|
149
|
+
*
|
|
150
|
+
* @param {(string|number)} statusCode
|
|
151
|
+
* @returns {(boolean|object)}
|
|
149
152
|
*/
|
|
150
|
-
getResponseByStatusCode(statusCode: string | number):
|
|
153
|
+
getResponseByStatusCode(statusCode: string | number): boolean | RMOAS.ResponseObject;
|
|
151
154
|
/**
|
|
152
|
-
*
|
|
155
|
+
* Retrieve an array of response examples that this operation has.
|
|
156
|
+
*
|
|
157
|
+
* @returns {Array}
|
|
153
158
|
*/
|
|
154
159
|
getResponseExamples(): ResponseExamples;
|
|
155
160
|
/**
|
|
156
|
-
*
|
|
161
|
+
* Determine if the operation has callbacks.
|
|
162
|
+
*
|
|
163
|
+
* @returns {boolean}
|
|
157
164
|
*/
|
|
158
165
|
hasCallbacks(): boolean;
|
|
159
166
|
/**
|
|
@@ -164,15 +171,19 @@ export default class Operation {
|
|
|
164
171
|
* @param identifier Callback identifier to look for.
|
|
165
172
|
* @param expression Callback expression to look for.
|
|
166
173
|
* @param method HTTP Method on the callback to look for.
|
|
167
|
-
* @returns
|
|
174
|
+
* @returns {(false|Callback)}
|
|
168
175
|
*/
|
|
169
176
|
getCallback(identifier: string, expression: string, method: RMOAS.HttpMethods): false | Callback;
|
|
170
177
|
/**
|
|
171
|
-
*
|
|
178
|
+
* Retrieve an array of operations created from each callback.
|
|
179
|
+
*
|
|
180
|
+
* @returns {Array}
|
|
172
181
|
*/
|
|
173
|
-
getCallbacks(): false |
|
|
182
|
+
getCallbacks(): false | Array<false | Callback>;
|
|
174
183
|
/**
|
|
175
|
-
*
|
|
184
|
+
* Retrieve an array of callback examples that this operation has.
|
|
185
|
+
*
|
|
186
|
+
* @returns {Array}
|
|
176
187
|
*/
|
|
177
188
|
getCallbackExamples(): CallbackExamples;
|
|
178
189
|
/**
|
|
@@ -195,12 +206,17 @@ export default class Operation {
|
|
|
195
206
|
getExtension(extension: string): unknown;
|
|
196
207
|
}
|
|
197
208
|
export declare class Callback extends Operation {
|
|
209
|
+
/**
|
|
210
|
+
* The identifier that this callback is set to.
|
|
211
|
+
*/
|
|
198
212
|
identifier: string;
|
|
199
|
-
constructor(
|
|
213
|
+
constructor(oas: RMOAS.OASDocument, path: string, method: RMOAS.HttpMethods, operation: RMOAS.OperationObject, identifier: string);
|
|
200
214
|
/**
|
|
215
|
+
* Return the primary identifier for this callback.
|
|
216
|
+
*
|
|
201
217
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object}
|
|
202
218
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callbackObject}
|
|
203
|
-
* @returns
|
|
219
|
+
* @returns {string}
|
|
204
220
|
*/
|
|
205
221
|
getIdentifier(): string;
|
|
206
222
|
}
|
package/@types/rmoas.types.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ import type { JSONSchema4, JSONSchema6, JSONSchema7 } from 'json-schema';
|
|
|
5
5
|
* @returns If the supplied data has a `$ref` pointer.
|
|
6
6
|
*/
|
|
7
7
|
export declare function isRef(check: unknown): check is OpenAPIV3.ReferenceObject | OpenAPIV3_1.ReferenceObject;
|
|
8
|
+
/**
|
|
9
|
+
* @param check API definition to determine if it's a 3.1 definition.
|
|
10
|
+
* @returns If the definition is a 3.1 definition.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isOAS31(check: OpenAPIV3.Document | OpenAPIV3_1.Document): check is OpenAPIV3_1.Document;
|
|
8
13
|
export interface User {
|
|
9
14
|
[key: string]: unknown;
|
|
10
15
|
keys?: Array<{
|
|
@@ -92,6 +97,11 @@ export declare type ExampleObject = OpenAPIV3.ExampleObject | OpenAPIV3_1.Exampl
|
|
|
92
97
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#tagObject}
|
|
93
98
|
*/
|
|
94
99
|
export declare type TagObject = OpenAPIV3.TagObject | OpenAPIV3_1.TagObject;
|
|
100
|
+
/**
|
|
101
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#headerObject}
|
|
102
|
+
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#headerObject}
|
|
103
|
+
*/
|
|
104
|
+
export declare type HeaderObject = OpenAPIV3.HeaderObject | OpenAPIV3_1.HeaderObject;
|
|
95
105
|
/**
|
|
96
106
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaObject}
|
|
97
107
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject}
|
|
@@ -101,7 +111,19 @@ export declare type SchemaObject = (OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaO
|
|
|
101
111
|
readOnly?: boolean;
|
|
102
112
|
writeOnly?: boolean;
|
|
103
113
|
'x-readme-ref-name'?: string;
|
|
114
|
+
example?: unknown;
|
|
115
|
+
examples?: Array<unknown>;
|
|
116
|
+
nullable?: boolean;
|
|
117
|
+
xml?: unknown;
|
|
118
|
+
externalDocs?: unknown;
|
|
119
|
+
components?: OpenAPIV3_1.ComponentsObject;
|
|
104
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* @param check JSON Schema object to determine if it's a non-polymorphic schema.
|
|
123
|
+
* @param isPolymorphicAllOfChild If this JSON Schema object is the child of a polymorphic `allOf`.
|
|
124
|
+
* @returns If the JSON Schema object is a JSON Schema object.
|
|
125
|
+
*/
|
|
126
|
+
export declare function isSchema(check: unknown, isPolymorphicAllOfChild?: boolean): check is SchemaObject;
|
|
105
127
|
/**
|
|
106
128
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#securitySchemeObject}
|
|
107
129
|
* @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#securitySchemeObject}
|
package/@types/utils.d.ts
CHANGED
|
@@ -4,12 +4,8 @@ declare const _default: {
|
|
|
4
4
|
findSchemaDefinition: typeof findSchemaDefinition;
|
|
5
5
|
getSchema: typeof getSchema;
|
|
6
6
|
jsonSchemaTypes: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
body: string;
|
|
10
|
-
cookie: string;
|
|
11
|
-
formData: string;
|
|
12
|
-
header: string;
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
[key: number]: string;
|
|
13
9
|
};
|
|
14
10
|
matchesMimeType: {
|
|
15
11
|
formUrlEncoded: (mimeType: string) => boolean;
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## 17.3.0 (2021-12-06)
|
|
2
|
+
|
|
3
|
+
* feat: OAS 3.1 for JSON Schemas (#530) ([91475da](https://github.com/readmeio/oas/commit/91475da)), closes [#530](https://github.com/readmeio/oas/issues/530)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
1
7
|
## 17.2.0 (2021-12-02)
|
|
2
8
|
|
|
3
9
|
* chore(deps-dev): bump @commitlint/cli from 14.1.0 to 15.0.0 (#552) ([b03dbd3](https://github.com/readmeio/oas/commit/b03dbd3)), closes [#552](https://github.com/readmeio/oas/issues/552)
|