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
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user