integer-schema-must-define-maximum
Requires maximum on integer and number schemas declared as components or direct component properties.
| Attribute | Value |
|---|---|
| Category | Schema |
| Maturity | Gold |
| OpenAPI | Swagger 2.0; OpenAPI 3.0, 3.1, 3.2 |
| Starter | Off |
| Lenient–Strict | Warning |
| Complete | Error |
Intent
An upper bound documents domain capacity and prevents unbounded numeric test data.
Flags
Top-level component schemas and their direct properties whose resolved type is integer or number and whose maximum is absent.
Nested schemas outside those component locations are not checked.
See it fail
components:
schemas:
PageSize:
type: integer
minimum: 1
Diagnostic: Numeric schemas should define \maximum`.`
Fix it
PageSize:
type: integer
minimum: 1
maximum: 100
Configure
profiles:
default:
rules:
extends: [recommended]
override:
integer-schema-must-define-maximum: error
Nearby: integer-schema-must-define-minimum, invalid-numeric-bounds, integer-bounds-required.