-
Notifications
You must be signed in to change notification settings - Fork 133
/
VTEX - Template openAPI.jsonc
232 lines (232 loc) · 10.6 KB
/
VTEX - Template openAPI.jsonc
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// This is a template file, set as .jsonc only to be able to hold comments. All openapi files tech writers create or edit must be .json and cannot contain comments.
{
"openapi": "3.0.0",
"info": {
"version": "{version-number}",
"title": "{api-title}",
"description": "{api-description}"
},
"servers": [
{
"url": "https://{accountName}.{environment}.com.br",
"description": "VTEX server URL.",
"variables": {
"accountName": {
"description": "Name of the VTEX account. Used as part of the URL",
"default": "apiexamples"
},
"environment": {
"description": "Environment to use. Used as part of the URL.",
"enum": [
"vtexcommercestable"
],
"default": "vtexcommercestable"
}
}
}
],
"paths": {
"/{path}": {
"{method}": {
"tags": [
"{applicable-tags}"
],
"summary": "{method-summary}",
"operationId": "{operation-id}", // Legacy field. Maintain this field if it already exists in an API. Do not include it if documenting new endpoints.
"description": "{method-description}",
"parameters": [
{
"$ref": "#/components/parameters/Content-Type"
},
{
"$ref": "#/components/parameters/Accept"
}
],
"requestBody": { // Do not include "requestBody" for GET requests.
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"{field1}",
"{field2-array-example}",
"{field3-object-example}"
],
"properties": {
"{field1}": {
"type": "{field1-type}",
"description": "{field1-description}.",
"example": "{field1-value-example}"
},
"{field2-array-example}": {
"type": "array",
"description": "{field2-description}.",
"items": {
"type": "object",
"description": "{items-description}",
"required": [
"{field2.[].1}",
"{field2.[].2}",
"{field2.[].3}"
],
"properties": {
"{field2.[].1}": {
"type": "string",
"description": "{field2.[].1-description}.",
"example": "{field2.[].1-example}"
},
"{field2.[].2}": {
"type": "boolean",
"description": "{field2.[].2-description}.",
"example": "{field2.[].2-example}"
},
"{field2.[].3}": {
"type": "integer",
"description": "{field2.[].3-description}.",
"example": "{field2.[].3-example}"
}
}
}
},
"{field3-object-example}": {
"type": "object",
"description": "{field3-description}.",
"required": [
"{field3.1}",
"{field3.2}",
"{field3.3}"
],
"properties": {
"{field3.1}": {
"type": "string",
"description": "{field3.1-description}.",
"example": "{field3.1-example}"
},
"{field3.2}": {
"type": "integer",
"description": "{field3[].2-description}.",
"example": "{field3.2-example}",
"deprecated": true // Optional field. Use "deprecated" in case it is true, meaning it has no effect.
},
"{field.3}": {
"type": "boolean",
"description": "{field3.3-description}.",
"example": "{field3.3-example}"
}
}
}
}
}
}
}
},
"responses": {
"{status}": {
"description": "{status-code-name}",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"{response-field1}": {
"type": "{response-field1-type}",
"description": "{response-field1-description}.",
"nullable": true // Optional field. Use "nullable" in case it is true, meaning "null" is a possible value.
},
"{response-field2}": {
"type": "{response-field2-type}",
"description": "{response-field2-description}."
},
"{response-field3}": {
"type": "{response-field3-type}",
"description": "{response-field3-description}."
}
}
},
"example": {
"{response-field1}": "{response-field1-value}",
"{response-field2}": "{response-field2-value}",
"{response-field3}": "{response-field3-value}"
}
}
}
}
}
}
}
},
"security": [
{
"appKey": [],
"appToken": []
},
{
"VtexIdclientAutCookie": []
}
],
"components": {
"securitySchemes": {
"appKey": {
"type": "apiKey",
"in": "header",
"name": "X-VTEX-API-AppKey",
"description": "Unique identifier of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys)."
},
"appToken": {
"type": "apiKey",
"in": "header",
"name": "X-VTEX-API-AppToken",
"description": "Secret token of the [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys)."
},
"VtexIdclientAutCookie": {
"type": "apiKey",
"in": "header",
"name": "VtexIdclientAutCookie",
"description": "[User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours."
}
},
"parameters": {
"Content-Type": {
"name": "Content-Type",
"in": "header",
"description": "Type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
"Accept": {
"name": "Accept",
"in": "header",
"description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
"{query-parameter}": {
"name": "{query-parameter}",
"in": "query",
"description": "{query-parameter-description}",
"required": false,
"style": "form",
"schema": {
"type": "string",
"example": "{query-parameter-example}"
}
}
}
},
"tags": [
{
"name": "{category1_name}"
},
{
"name": "{category2_name}"
}
]
}