valid-parameter-example
Overview
This rule belongs to the openapi-v3-docsgen-linting ruleset and states that:
The example value specified for the Parameter Object using either the example property or examples must be valid for the schema definition provided for that parameter.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Warning |
| Message | Parameter example does not conform to its schema definition. |
| Code | OPENAPI3DOCSGEN_L382 |
| Type | Linting |
| Rule System | Semantic |
| Broad Category | OpenAPI Parameters |
| Products Impacted | Developer Experience Portal |
| Tags | documentation generation documentation docs openapi3 openapi semantic linting apimatic examples example value parameter schema |
Suggested Fixes
- Ensure that parameter example value conforms to the parameter schema definition.
- Check that no required properties are missing in the sample value.
- Check that types of all properties match those specified in the schema definition.