-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path0135.yaml
More file actions
50 lines (46 loc) · 1.4 KB
/
0135.yaml
File metadata and controls
50 lines (46 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
aliases:
DeleteOperation:
description: A Delete operation is a delete on path that ends in a path parameter
targets:
- formats: ['oas2', 'oas3']
given:
# first condition excludes custom methods and second condition matches paths ending in a path parameter
- $.paths[?(!@property.match(/:[^/]*$/) && @property.match(/\}$/))].delete
functionsDir: ../functions
functions:
- delete-no-request-body
- delete-response-204
rules:
aep-135-http-body:
description: A delete operation must not accept a request body.
message: '{{error}}'
severity: error
formats: ['oas3']
given:
- $.paths[*]
then:
function: delete-no-request-body
aep-135-operation-id:
description: The operation ID should be Delete{resource-singular}.
message: The operation ID does not conform to AEP-135
severity: error
formats: ['oas2', 'oas3']
given: '#DeleteOperation'
then:
function: schema
functionOptions:
schema:
type: object
properties:
operationId:
type: string
pattern: '^[Dd][Ee][Ll][Ee][Tt][Ee][A-Z].*$'
required: ['operationId']
aep-135-response-204:
description: A delete operation should have a 204 response.
message: '{{error}}'
severity: warn
formats: ['oas2', 'oas3']
given: $.paths[*]
then:
function: delete-response-204