valid-property-value-type
Overview
This rule belongs to the openapi-v3-syntax-validation
ruleset and states that:
Value of an OpenAPI standard property must be in accordance with the type set by the standard for that property.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Property value does not conform to the expected property type. |
Code | OPENAPI3SYNTAX_V222 |
Type | Validation |
Rule System | Syntax |
Broad Category | Miscellaneous |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi syntax validation type property value property |
Suggested Fixes
- If an array is expected, ensure that your value is surrounded by square brackets [ and ].
- If an array is not expected, ensure that your value contains a single item only and is not surrounded by square brackets [ and ].
- If a numeric value is expected, ensure that your value is a valid number and it is not surrounded by single or double quotes.
- If a string value is expected, ensure that it is escaped properly and surrounded by quotes if necessary.
- If an object is expected, ensure that your value is a key-value map.