OpenAPI Parameters Optional Examples (Edit)

Optional parameters should include examples to support API mocking, testing, and documentation. While not strictly required, examples help consumers understand the range of acceptable values.

OpenAPIParametersExamplesMocking

Rule Definition

openapi-parameters-optional-examples-info.yaml
{"openapi-parameters-optional-examples-info":{"description":"Optional parameters should include examples to support API mocking, testing, and documentation. While not strictly required, examples help consumers understand the range of acceptable values.","message":"Optional parameters SHOULD include examples.","given":"$.paths[*][*].parameters[?(@.required==false)]","severity":"info","then":{"function":"xor","functionOptions":{"properties":["example","examples"]}}}}

Back to All of the Rules