Skip to main content

invalid-numeric-bounds

Rejects numeric schemas whose upper bound is smaller than their lower bound.

AttributeValue
CategorySchema
MaturityPlatinum
OpenAPISwagger 2.0; OpenAPI 3.0, 3.1, 3.2
StarterOff
LenientWarning
Recommended–CompleteError

Intent

Inverted bounds describe an empty numeric range, so no value can satisfy the schema.

Flags

A schema where a numeric maximum or exclusiveMaximum is below its numeric minimum or exclusiveMinimum. The rule also understands the boolean exclusive-bound form used by Swagger 2.0 and OpenAPI 3.0.

Does not flag

Equal inclusive bounds, ascending bounds, or a schema that does not provide both sides of the range.

See it fail

quantity:
type: integer
minimum: 10
maximum: 5

Diagnostic: maximum 5 cannot be less than minimum 10

Fix it

quantity:
type: integer
minimum: 5
maximum: 10

Configure

profiles:
default:
rules:
extends: [recommended]
override:
invalid-numeric-bounds: warn

Nearby: integer-schema-must-define-minimum, integer-schema-must-define-maximum.