Add az-request-body-type rule.
This commit is contained in:
Родитель
a6c446c3d4
Коммит
33d465842d
|
@ -255,6 +255,10 @@ RFC7231 states that the payload for both get and delete "has no defined semantic
|
|||
|
||||
Flag a body parameter/request body that is not marked as required. This is a common oversight.
|
||||
|
||||
### az-request-body-type
|
||||
|
||||
Request body schema must not be a bare array.
|
||||
|
||||
### az-response-body-type
|
||||
|
||||
Response body schema must not be a bare array.
|
||||
|
|
|
@ -547,6 +547,18 @@ rules:
|
|||
field: required
|
||||
function: truthy
|
||||
|
||||
az-request-body-type:
|
||||
description: Request body schema must not be a bare array.
|
||||
severity: warn
|
||||
formats: ['oas2']
|
||||
given:
|
||||
- $.paths[*].[put,post,patch].parameters.[?(@.in == 'body')].schema
|
||||
then:
|
||||
field: type
|
||||
function: pattern
|
||||
functionOptions:
|
||||
notMatch: '/^array$/'
|
||||
|
||||
az-response-body-type:
|
||||
description: Response body schema must not be a bare array.
|
||||
severity: warn
|
||||
|
|
Загрузка…
Ссылка в новой задаче