forked from Mermade/oas-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules.yaml
118 lines (118 loc) · 2.97 KB
/
rules.yaml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
rules:
- name: parameter-description
object: parameter
description: parameter objects should have a description
truthy: description
- name: parameter-name-regex
object: parameter
description: parameter names should match RFC6570
pattern:
property: name
value: '^[A-Za-z0-9?_()]+$'
- name: operation-operationId
object: operation
description: operation should have an operationId
truthy: operationId
- name: operation-summary-or-description
object: operation
description: operation should have summary or description
or:
- summary
- description
- name: operation-tags
object: operation
description: operation should have non-empty tags array
truthy: tags
skip: isCallback
- name: path-keys-no-trailing-slash
object: paths
notEndWith:
property: $key
value: /
omit: /
- name: openapi-tags
object: openapi
description: openapi object should have non-empty tags array
truthy: tags
- name: reference-no-other-properties
object: reference
description: reference objects should only have a $ref property
truthy: $ref
properties: 1
- name: pathItem-summary-or-description
object: pathItem
disabled: true
description: pathItem should have summary or description
or:
- summary
- description
- name: example-value-or-externalValue
object: example
description: example should have either value or externalValue
xor:
- value
- externalValue
- name: reference-components-regex
object: reference
description: reference components should all match spec. regex
pattern:
property: $ref
omit: '#'
split: /
value: '^[a-zA-Z0-9\.\-_]+$'
- name: no-script-tags-in-markdown
object: '*'
description: markdown descriptions should not contain <script> tags
notContain:
properties:
- description
value: <script
- name: info-contact
object: info
description: info object should contain contact object
truthy: contact
- name: contact-properties
object: contact
description: 'contact object should have name, url and email'
truthy:
- name
- url
- email
- name: license-url
object: license
description: license object should include url
truthy: url
- name: server-not-example.com
object: server
description: server url should not point at example.com
notContain:
properties:
- url
value: example.com
- name: license-apimatic-bug
object: license
description: license url should not point at gruntjs
notContain:
properties:
- url
value: gruntjs
- name: no-eval-in-descriptions
object: '*'
description: markdown descriptions should not contain 'eval('
notContain:
properties:
- description
- title
value: eval(
- name: tag-description
object: tag
description: tag object should have a description
truthy: description
- name: schema-properties-type
object: schema
description: "schema objects containing properties should have type: object"
if:
property: properties
then:
property: type
value: object