schema-example-or-default-value-exists
Overview
This rule belongs to the openapi-v3-docsgen-linting ruleset and states that:
Schema Object must specify a non-null, non-empty example value using the example property or a default value using the default property if applicable.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Information |
| Message | Schema object example/default value is missing. |
| Code | OPENAPI3DOCSGEN_L753 |
| Type | Linting |
| Rule System | Semantic |
| Broad Category | OpenAPI Schemas |
| Products Impacted | Developer Experience Portal |
| Tags | documentation generation documentation docs openapi3 openapi semantic linting apimatic default value value default example schema |
Suggested Fixes
- If the schema definition has a default value, it must be specified using the
defaultvalue. - If the schema has no default value, ensure that the
exampleproperty is present in the Schema Object. - Ensure that the schema example or default value is not empty or null.
- The example or default value specified must be valid in accordance with the schema type definition.