-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.yaml
180 lines (168 loc) · 3.86 KB
/
api.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
swagger: '2.0'
info:
title: Swali
description: Swagger Linter
version: "1.0"
contact:
email: [email protected]
host: "ijgf82g4o9.execute-api.us-west-2.amazonaws.com"
schemes:
- https
basePath: /api
parameters:
LintingRequest:
paths:
'/violations':
post:
summary:
API Violations
description: |
The API Violations endpoint validates given Swagger Specification
against the rules defined in *Zalando* RESTful API Guidelines
(http://zalando.github.io/restful-api-guidelines/). The response
includes the list of violations for API spec submitted
parameters:
- name: Request
in: body
description: Linting Request
required: true
schema:
$ref: '#/definitions/LintingRequest'
consumes:
- application/json
produces:
- application/json
responses:
200:
description: API swagger is OK
schema:
$ref: '#/definitions/LintingResponse'
400:
description: Input file not parsable
schema:
$ref: 'https://zalando.github.io/problem/schema.yaml#/Problem'
default:
description: Error description
schema:
$ref: 'https://zalando.github.io/problem/schema.yaml#/Problem'
'/supported-rules':
get:
description: |
Returns a list of rules which are supported by Swali
consumes:
- application/json
produces:
- application/json
responses:
200:
description: List of supported rules is successfully returned
schema:
$ref: '#/definitions/SupportedRulesResponse'
definitions:
LintingRequest:
type: object
description: Request containing a swagger definition file
properties:
api_definition:
type: string
api_definition_url:
type: string
ignoreRules:
type: array
items:
type: string
LintingResponse:
type: object
description: Linting Response
required:
- violations
properties:
violations:
type: array
items:
$ref: '#/definitions/Violation'
message:
type: string
violations_count:
$ref: '#/definitions/ViolationsCount'
Violation:
type: object
description: Violation Object
required:
- title
- description
- violation_type
properties:
title:
type: string
description:
type: string
violation_type:
type: string
x-extensible-enum:
- MUST
- SHOULD
- MAY
- HINT
rule_link:
type: string
paths:
type: array
items:
type: string
ViolationsCount:
type: object
description: Violation Count
required:
- must
- should
- may
- could
- hint
properties:
must:
type: integer
format: int32
should:
type: integer
format: int32
may:
type: integer
format: int32
could:
type: integer
format: int32
hint:
type: integer
format: int32
SupportedRulesResponse:
type: object
description: Supported Rules
required:
- supported_rules
properties:
supported_rules:
type: array
items:
$ref: '#/definitions/Rule'
Rule:
type: object
description: Rule
required:
- title
- code
- type
- url
properties:
title:
type: string
example: 'Do Not Use URI Versioning'
code:
type: string
example: '115'
type:
type: string
example: 'MUST'
url:
type: string
example: 'https://zalando.github.io/restful-api-guidelines/compatibility/Compatibility.html#must-do-not-use-uri-versioning'