-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.redocly.yaml
116 lines (106 loc) · 2.82 KB
/
.redocly.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
# See https://redocly.com/docs/cli/configuration/ for more information.
# See https://github.com/Redocly/redocly-cli-cookbook for examples.
extends:
- recommended
apis:
main:
root: openapi-definitions/openapi.yaml
theme:
openapi:
htmlTemplate: ./docs/auto/index.html
theme:
colors:
primary:
main: "#32329f"
generateCodeSamples:
languages: # Array of language config objects; indicates in which languages to generate code samples.
- lang: curl
- lang: Node.js
- lang: JavaScript
- lang: PHP
- lang: Python
- lang: Java
- lang: C#
- lang: Go
rules:
spec-strict-refs: warn
operation-4xx-response: off
rule/post-should-define-requestBody:
severity: error
message: '"POST" SHOULD define a "requestBody" schema unless using an "actions" pattern'
subject:
type: Operation
where:
- subject:
type: PathItem
# Here you can define your own URI pattern to ignore if providing a requestBody is not required.
# The negation happens in this portion of the regex `(?<!/actions)`.
# The regex takes the entire URI pattern string and then uses a "negative lookbehind" from the end of the string to find the pattern to be negated.
matchParentKeys: /^([\w-\{\}/.](?<!/actions))*$/
assertions:
defined: true
- subject:
type: Operation
filterInParentKeys:
- post
assertions:
disallowed:
- deprecated
assertions:
required:
- requestBody
rule/get-should-not-define-requestBody:
severity: error
message: '"GET" SHOULD NOT define a "requestBody" schema'
subject:
type: Operation
filterInParentKeys:
- get
assertions:
disallowed:
- requestBody
rule/info-description:
subject:
type: Info
property: description
assertions:
defined: true
rule/no-script-tags-in-markdown:
subject:
type: any
property: description
assertions:
notPattern: '<script'
severity: warn
message: Markdown descriptions should not contain script tags.
# rule/string-schemas-length-defined:
# severity: warn
# subject:
# type: Schema
# where:
# - subject:
# type: Schema
# property: type
# assertions:
# const: string
# assertions:
# requireAny:
# - minLength
# - maxLength
# - enum
# mutuallyRequired:
# - minLength
# - maxLength
rule/json-schema-string-misconfiguration:
subject:
type: Schema
where:
- subject:
type: Schema
property: type
assertions:
const: string
assertions:
disallowed:
- minimum
- maximum