forked from italia/api-oas-checker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatch.yml
23 lines (22 loc) · 867 Bytes
/
patch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#
# See technical recommendations on Italian Guidelines:
#
# https://docs.italia.it/italia/piano-triennale-ict/lg-modellointeroperabilita-docs/it/bozza/doc/profili-di-interazione/regole-comuni-rest-soap.html#raccomandazioni-tecniche-per-rest
#
# extends: spectral:oas
rules:
patch-media-type:
description: |-
application/json is not an appropriate media-type for PATCH.
See https://docs.italia.it/italia/piano-triennale-ict/lg-modellointeroperabilita-docs/it/bozza/doc/profili-di-interazione/regole-comuni-rest-soap.html#usare-lo-schema-problem-json-per-le-risposte-di-errore
message: >-
application/json is not an appropriate media-type for PATCH. {{path}}
formats:
- oas3
severity: error
recommended: true
given: >-
$.[patch][requestBody][content]
then:
field: application/json
function: falsy