schema-multiple-of-greater-than-zero
Overview
This rule belongs to the openapi-v3-standards-validation ruleset and states that:
The numeric validation keyword multipleOf must have a value that is strictly greater than zero (0).
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Value of property multipleOf is not greater than 0. |
| Code | OPENAPI3STANDARDS_V326 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Schemas |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi standards semantic validation multiple of number json schema validation json schema |
Suggested Fixes
- Ensure that the value for the validation keyword is a valid number.
- Ensure that the value is not set to 0.
- Ensure that the value is not less than 0 i.e. a negative value.
For More Information
- https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-6.2.1
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object
- https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.1
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/