Skip to main content

parameter-length-required

Requires string parameters to define both maxLength and a non-blank pattern.

AttributeValue
CategoryParameters
MaturityGold
StarterOff
Lenient–StrictWarning
CompleteError

Flags

String parameters in query, path, header, or cookie locations. Direct string properties inside component schemas are also checked.

See it fail

- in: query
name: countryCode
schema: { type: string }

Fix it

- in: query
name: countryCode
schema: { type: string, maxLength: 2, pattern: '^[A-Z]{2}$' }

Nearby: parameter-description, string-schema-length.