mirror of
https://github.com/adidas/api-guidelines.git
synced 2025-10-25 15:19:19 +00:00
Add oas2 check for example or ref existance in a body parameter
This commit is contained in:
@@ -98,16 +98,16 @@ rules:
|
||||
type: string
|
||||
enum:
|
||||
- application/json
|
||||
# example-exists-in-parameters:
|
||||
# description: All models MUST have a valid example.
|
||||
# severity: error
|
||||
# recommended: true
|
||||
# formats:
|
||||
# - oas2
|
||||
# message: "{{ property }} MUST have a valid example."
|
||||
# given: "$..parameters..[?(@.in == 'body')]..[?( !@.example || !@.schema.$ref)]"
|
||||
# then:
|
||||
# function: falsy
|
||||
example-exists-in-parameters:
|
||||
description: All models MUST have a valid example.
|
||||
severity: error
|
||||
recommended: true
|
||||
formats:
|
||||
- oas2
|
||||
message: "{{ property }} MUST have a valid example."
|
||||
given: "$..parameters..[?(@.in == 'body' && (@.example || @.schema.$ref))]"
|
||||
then:
|
||||
function: truthy
|
||||
# example-exists-in-definitions:
|
||||
# description: All models MUST have a valid example.
|
||||
# severity: error
|
||||
|
||||
Reference in New Issue
Block a user