We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ee7f654 + 334e7e1 commit b867b0aCopy full SHA for b867b0a
lib/openapi-typings.ts
@@ -35,7 +35,20 @@ export function isReferenceObject(obj: any): obj is ReferenceObject {
35
* Type guard to check if a schema is an ArraySchemaObject
36
*/
37
export function isArraySchemaObject(obj: SchemaObject): obj is ArraySchemaObject {
38
- return 'type' in obj && obj.type === 'array' && 'items' in obj;
+ if (!('type' in obj)) {
39
+ return false;
40
+ }
41
+ if (!('items' in obj)) {
42
43
44
+ if (obj.type === 'array') {
45
+ return true;
46
47
+ // OpenAPI 3.1 allows 'type' to be an array of types, so we need to check if it includes 'array'
48
+ if (Array.isArray(obj.type) && obj.type.includes('array')) {
49
50
51
52
}
53
54
/**
0 commit comments