schema-max-properties-cannot-be-less-than-min-properties
Overview
This rule belongs to the openapi-v3-apimatic-linting ruleset and states that:
In OpenAPI specifications, if a minimum number of properties is defined for a schema, then a maximum number of properties should also be defined, and the maximum number of properties should be equal to or greater than the minimum number of properties.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Warning |
| Message | Maximum properties is less than the minimum properties. |
| Code | OPENAPI3APIMATIC_L683 |
| Type | Linting |
| Rule System | Semantic |
| Broad Category | OpenAPI Schemas |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi apimatic semantic linting minimum properties greater less maximum properties |
Suggested Fixes
- Check the OpenAPI specification to confirm if the minimum and maximum number of properties are defined for the schema.
- If either the minimum or maximum number of properties is missing, add the missing property to the schema definition.
- Make sure that the minimum and maximum number of properties are specified with appropriate data types (integer) and have non-negative values.
- Ensure that the maximum number of properties is equal to or greater than the minimum number of properties.