From a548c5bdaf4d6bd93b42860ccf559d91956a52f5 Mon Sep 17 00:00:00 2001 From: Anton_Kozachuk Date: Thu, 19 May 2022 14:43:31 +0300 Subject: [PATCH 1/3] chore: add missing array types for 3.1 --- packages/core/src/types/oas3_1.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/src/types/oas3_1.ts b/packages/core/src/types/oas3_1.ts index 43c61ff937..200160f8c9 100755 --- a/packages/core/src/types/oas3_1.ts +++ b/packages/core/src/types/oas3_1.ts @@ -127,6 +127,8 @@ const Schema: NodeType = { dependentSchemas: listOf('Schema'), prefixItems: listOf('Schema'), contains: 'Schema', + minContains: { type: 'number' }, + maxContains: { type: 'number' }, patternProperties: { type: 'object' }, propertyNames: 'Schema', unevaluatedItems: 'Schema', From 0fd1c240146a0f7bad974ff5837690311d955a75 Mon Sep 17 00:00:00 2001 From: Anton_Kozachuk Date: Thu, 19 May 2022 18:37:44 +0300 Subject: [PATCH 2/3] Fix some data types --- packages/core/src/types/oas3_1.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/core/src/types/oas3_1.ts b/packages/core/src/types/oas3_1.ts index 200160f8c9..0ca38708f6 100755 --- a/packages/core/src/types/oas3_1.ts +++ b/packages/core/src/types/oas3_1.ts @@ -90,19 +90,19 @@ const Schema: NodeType = { discriminator: 'Discriminator', myArbitraryKeyword: { type: 'boolean' }, title: { type: 'string' }, - multipleOf: { type: 'number' }, + multipleOf: { type: 'number', minimum: 0 }, maximum: { type: 'number' }, minimum: { type: 'number' }, exclusiveMaximum: { type: 'number' }, exclusiveMinimum: { type: 'number' }, - maxLength: { type: 'number' }, - minLength: { type: 'number' }, + maxLength: { type: 'number', minimum: 0 }, + minLength: { type: 'number', minimum: 0 }, pattern: { type: 'string' }, - maxItems: { type: 'number' }, - minItems: { type: 'number' }, + maxItems: { type: 'number', minimum: 0 }, + minItems: { type: 'number', minimum: 0 }, uniqueItems: { type: 'boolean' }, - maxProperties: { type: 'number' }, - minProperties: { type: 'number' }, + maxProperties: { type: 'number', minimum: 0 }, + minProperties: { type: 'number', minimum: 0 }, required: { type: 'array', items: { type: 'string' } }, enum: { type: 'array' }, type: (value: any) => { @@ -127,8 +127,8 @@ const Schema: NodeType = { dependentSchemas: listOf('Schema'), prefixItems: listOf('Schema'), contains: 'Schema', - minContains: { type: 'number' }, - maxContains: { type: 'number' }, + minContains: { type: 'number', minimum: 0 }, + maxContains: { type: 'number', minimum: 0 }, patternProperties: { type: 'object' }, propertyNames: 'Schema', unevaluatedItems: 'Schema', From d80408d2ea3c7e5549ef8754f85759bc311d72de Mon Sep 17 00:00:00 2001 From: Anton_Kozachuk Date: Mon, 23 May 2022 12:11:09 +0300 Subject: [PATCH 3/3] Change data types to integer --- packages/core/src/types/oas3.ts | 12 ++++++------ packages/core/src/types/oas3_1.ts | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/core/src/types/oas3.ts b/packages/core/src/types/oas3.ts index 37af71a65a..d135760efc 100755 --- a/packages/core/src/types/oas3.ts +++ b/packages/core/src/types/oas3.ts @@ -275,14 +275,14 @@ const Schema: NodeType = { minimum: { type: 'number' }, exclusiveMaximum: { type: 'boolean' }, exclusiveMinimum: { type: 'boolean' }, - maxLength: { type: 'number', minimum: 0 }, - minLength: { type: 'number', minimum: 0 }, + maxLength: { type: 'integer', minimum: 0 }, + minLength: { type: 'integer', minimum: 0 }, pattern: { type: 'string' }, - maxItems: { type: 'number', minimum: 0 }, - minItems: { type: 'number', minimum: 0 }, + maxItems: { type: 'integer', minimum: 0 }, + minItems: { type: 'integer', minimum: 0 }, uniqueItems: { type: 'boolean' }, - maxProperties: { type: 'number', minimum: 0 }, - minProperties: { type: 'number', minimum: 0 }, + maxProperties: { type: 'integer', minimum: 0 }, + minProperties: { type: 'integer', minimum: 0 }, required: { type: 'array', items: { type: 'string' } }, enum: { type: 'array' }, type: { diff --git a/packages/core/src/types/oas3_1.ts b/packages/core/src/types/oas3_1.ts index 0ca38708f6..a8facc757a 100755 --- a/packages/core/src/types/oas3_1.ts +++ b/packages/core/src/types/oas3_1.ts @@ -95,14 +95,14 @@ const Schema: NodeType = { minimum: { type: 'number' }, exclusiveMaximum: { type: 'number' }, exclusiveMinimum: { type: 'number' }, - maxLength: { type: 'number', minimum: 0 }, - minLength: { type: 'number', minimum: 0 }, + maxLength: { type: 'integer', minimum: 0 }, + minLength: { type: 'integer', minimum: 0 }, pattern: { type: 'string' }, - maxItems: { type: 'number', minimum: 0 }, - minItems: { type: 'number', minimum: 0 }, + maxItems: { type: 'integer', minimum: 0 }, + minItems: { type: 'integer', minimum: 0 }, uniqueItems: { type: 'boolean' }, - maxProperties: { type: 'number', minimum: 0 }, - minProperties: { type: 'number', minimum: 0 }, + maxProperties: { type: 'integer', minimum: 0 }, + minProperties: { type: 'integer', minimum: 0 }, required: { type: 'array', items: { type: 'string' } }, enum: { type: 'array' }, type: (value: any) => { @@ -127,8 +127,8 @@ const Schema: NodeType = { dependentSchemas: listOf('Schema'), prefixItems: listOf('Schema'), contains: 'Schema', - minContains: { type: 'number', minimum: 0 }, - maxContains: { type: 'number', minimum: 0 }, + minContains: { type: 'integer', minimum: 0 }, + maxContains: { type: 'integer', minimum: 0 }, patternProperties: { type: 'object' }, propertyNames: 'Schema', unevaluatedItems: 'Schema',