@redocly/openapi-core
Advanced tools
Comparing version 1.0.0-beta.60 to 1.0.0-beta.61
@@ -109,2 +109,10 @@ "use strict"; | ||
} | ||
if (typeof propSchema.minimum === 'number') { | ||
if (propSchema.minimum > node[propName]) { | ||
report({ | ||
message: `The value of the ${propName} field must be greater than or equal to ${propSchema.minimum}`, | ||
location: location.child([propName]), | ||
}); | ||
} | ||
} | ||
} | ||
@@ -111,0 +119,0 @@ }, |
@@ -8,2 +8,3 @@ export declare type ScalarSchema = { | ||
directResolveAs?: string; | ||
minimum?: number; | ||
}; | ||
@@ -17,2 +18,3 @@ export declare type NormalizedScalarSchema = { | ||
resolvable: boolean; | ||
minimum?: number; | ||
}; | ||
@@ -19,0 +21,0 @@ export declare type NodeType = { |
@@ -328,3 +328,3 @@ "use strict"; | ||
title: { type: 'string' }, | ||
multipleOf: { type: 'number' }, | ||
multipleOf: { type: 'number', minimum: 0 }, | ||
maximum: { type: 'number' }, | ||
@@ -334,10 +334,10 @@ minimum: { type: 'number' }, | ||
exclusiveMinimum: { type: 'boolean' }, | ||
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' } }, | ||
@@ -344,0 +344,0 @@ enum: { type: 'array' }, |
{ | ||
"name": "@redocly/openapi-core", | ||
"version": "1.0.0-beta.60", | ||
"version": "1.0.0-beta.61", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -113,2 +113,11 @@ import type { Oas3Rule, Oas2Rule } from '../../visitors'; | ||
} | ||
if (typeof propSchema.minimum === 'number') { | ||
if (propSchema.minimum > node[propName]) { | ||
report({ | ||
message: `The value of the ${propName} field must be greater than or equal to ${propSchema.minimum}`, | ||
location: location.child([propName]), | ||
}) | ||
} | ||
} | ||
} | ||
@@ -115,0 +124,0 @@ }, |
@@ -8,2 +8,3 @@ export type ScalarSchema = { | ||
directResolveAs?: string; | ||
minimum?: number; | ||
}; | ||
@@ -18,2 +19,3 @@ | ||
resolvable: boolean; | ||
minimum?: number; | ||
}; | ||
@@ -20,0 +22,0 @@ |
@@ -354,3 +354,3 @@ import { NodeType, listOf, mapOf } from '.'; | ||
title: { type: 'string' }, | ||
multipleOf: { type: 'number' }, | ||
multipleOf: { type: 'number', minimum: 0 }, | ||
maximum: { type: 'number' }, | ||
@@ -360,10 +360,10 @@ minimum: { type: 'number' }, | ||
exclusiveMinimum: { type: 'boolean' }, | ||
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' } }, | ||
@@ -370,0 +370,0 @@ enum: { type: 'array' }, |
Sorry, the diff of this file is not supported yet
1849790
22126