Add oas2 check for example or ref existance in a body parameter

This commit is contained in:
Jarzyna, Andrzej
2019-11-20 16:11:12 +01:00
parent a9549b2c3a
commit ccd1a28167

View File

@@ -98,16 +98,16 @@ rules:
type: string type: string
enum: enum:
- application/json - application/json
# example-exists-in-parameters: example-exists-in-parameters:
# description: All models MUST have a valid example. description: All models MUST have a valid example.
# severity: error severity: error
# recommended: true recommended: true
# formats: formats:
# - oas2 - oas2
# message: "{{ property }} MUST have a valid example." message: "{{ property }} MUST have a valid example."
# given: "$..parameters..[?(@.in == 'body')]..[?( !@.example || !@.schema.$ref)]" given: "$..parameters..[?(@.in == 'body' && (@.example || @.schema.$ref))]"
# then: then:
# function: falsy function: truthy
# example-exists-in-definitions: # example-exists-in-definitions:
# description: All models MUST have a valid example. # description: All models MUST have a valid example.
# severity: error # severity: error