OpenAPI Response Content Examples (Edit)

Response content should include examples to support API mocking, testing, and documentation. Examples enable tools to generate realistic mock responses and help consumers understand what to expect.

OpenAPIResponsesExamplesMocking

Rule Definition

openapi-response-content-examples-warn.yaml
{"openapi-response-content-examples-warn":{"description":"Response content should include examples to support API mocking, testing, and documentation. Examples enable tools to generate realistic mock responses and help consumers understand what to expect.","message":"Response content SHOULD include examples.","given":"$.paths[*][*].responses[*].content.*","severity":"warn","then":{"function":"xor","functionOptions":{"properties":["example","examples"]}}}}

Back to All of the Rules