Skip to main content

integer-schema-must-define-minimum

Requires minimum on integer and number schemas declared as components or direct component properties.

AttributeValue
CategorySchema
MaturityGold
OpenAPISwagger 2.0; OpenAPI 3.0, 3.1, 3.2
StarterOff
Lenient–StrictWarning
CompleteError

Intent

A lower bound communicates domain limits and prevents unexpectedly small or negative generated values.

Flags

Top-level component schemas and their direct properties whose resolved type is integer or number and whose minimum is absent.

Nested schemas outside those component locations are not checked.

See it fail

components:
schemas:
Quantity:
type: integer

Diagnostic: Numeric schemas should define \minimum`.`

Fix it

Quantity:
type: integer
minimum: 0

Configure

profiles:
default:
rules:
extends: [recommended]
override:
integer-schema-must-define-minimum: error

Nearby: integer-schema-must-define-maximum, invalid-numeric-bounds, integer-bounds-required.