mediaType-example-or-examples-exist
Overview
This rule belongs to the openapi-v3-docsgen-linting ruleset and states that:
Media Type Object must specify a non-null, non-empty example value using either the example or examples property.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Information |
| Message | Media type object example is missing. |
| Code | OPENAPI3DOCSGEN_L460 |
| Type | Linting |
| Rule System | Semantic |
| Broad Category | OpenAPI Media Types |
| Products Impacted | Developer Experience Portal |
| Tags | documentation generation documentation docs openapi3 openapi semantic linting apimatic examples example media type |
Suggested Fixes
- Ensure that either
exampleorexamplesproperty is present in the Media Type Object. exampleandexamplesare mutually exclusive properties.- When using the
exampleslist, make sure that the list is not empty. - Ensure that the media type example value is not empty or null.
- The example value specified must be valid in accordance with the media type schema definition.