@@ -42,34 +42,28 @@ def resolve_callback(self, callbacks):
42
42
43
43
Example: ::
44
44
45
- #Input
45
+ # Input
46
46
{
47
47
"userEvent": {
48
48
"https://my.example/user-callback": {
49
49
"post": {
50
50
"requestBody": {
51
- "content": {
52
- "application/json": {
53
- "schema": UserSchema
54
- }
55
- }
51
+ "content": {"application/json": {"schema": UserSchema}}
56
52
}
57
53
},
58
54
}
59
55
}
60
56
}
61
57
62
- #Output
58
+ # Output
63
59
{
64
60
"userEvent": {
65
61
"https://my.example/user-callback": {
66
62
"post": {
67
63
"requestBody": {
68
64
"content": {
69
65
"application/json": {
70
- "schema": {
71
- "$ref": "#/components/schemas/User"
72
- }
66
+ "schema": {"$ref": "#/components/schemas/User"}
73
67
}
74
68
}
75
69
}
@@ -97,19 +91,28 @@ def resolve_parameters(self, parameters):
97
91
98
92
Example: ::
99
93
100
- #Input
94
+ # Input
101
95
class UserSchema(Schema):
102
96
name = fields.String()
103
97
id = fields.Int()
104
98
105
- [
106
- {"in": "query", "schema": "UserSchema"}
107
- ]
108
99
109
- #Output
100
+ [{"in": "query", "schema": "UserSchema"}]
101
+
102
+ # Output
110
103
[
111
- {"in": "query", "name": "id", "required": False, "schema": {"type": "integer"}},
112
- {"in": "query", "name": "name", "required": False, "schema": {"type": "string"}}
104
+ {
105
+ "in": "query",
106
+ "name": "id",
107
+ "required": False,
108
+ "schema": {"type": "integer"},
109
+ },
110
+ {
111
+ "in": "query",
112
+ "name": "name",
113
+ "required": False,
114
+ "schema": {"type": "string"},
115
+ },
113
116
]
114
117
115
118
If the Parameter Object contains a `content` key a single Parameter
@@ -118,19 +121,23 @@ class UserSchema(Schema):
118
121
119
122
Example: ::
120
123
121
- #Input
122
- [{"in": "query", "name": "pet", "content":{"application/json": {"schema": "PetSchema"}} }]
124
+ # Input
125
+ [
126
+ {
127
+ "in": "query",
128
+ "name": "pet",
129
+ "content": {"application/json": {"schema": "PetSchema"}},
130
+ }
131
+ ]
123
132
124
- #Output
133
+ # Output
125
134
[
126
135
{
127
136
"in": "query",
128
137
"name": "pet",
129
138
"content": {
130
- "application/json": {
131
- "schema": {"$ref": "#/components/schemas/Pet"}
132
- }
133
- }
139
+ "application/json": {"schema": {"$ref": "#/components/schemas/Pet"}}
140
+ },
134
141
}
135
142
]
136
143
@@ -160,17 +167,17 @@ def resolve_response(self, response):
160
167
161
168
Example: ::
162
169
163
- #Input
170
+ # Input
164
171
{
165
172
"content": {"application/json": {"schema": "PetSchema"}},
166
173
"description": "successful operation",
167
174
"headers": {"PetHeader": {"schema": "PetHeaderSchema"}},
168
175
}
169
176
170
- #Output
177
+ # Output
171
178
{
172
179
"content": {
173
- "application/json":{"schema": {"$ref": "#/components/schemas/Pet"}}
180
+ "application/json": {"schema": {"$ref": "#/components/schemas/Pet"}}
174
181
},
175
182
"description": "successful operation",
176
183
"headers": {
@@ -192,26 +199,18 @@ def resolve_schema(self, data):
192
199
193
200
OpenAPIv3 Components: ::
194
201
195
- #Input
202
+ # Input
196
203
{
197
204
"description": "user to add to the system",
198
- "content": {
199
- "application/json": {
200
- "schema": "UserSchema"
201
- }
202
- }
205
+ "content": {"application/json": {"schema": "UserSchema"}},
203
206
}
204
207
205
- #Output
208
+ # Output
206
209
{
207
210
"description": "user to add to the system",
208
211
"content": {
209
- "application/json": {
210
- "schema": {
211
- "$ref": "#/components/schemas/User"
212
- }
213
- }
214
- }
212
+ "application/json": {"schema": {"$ref": "#/components/schemas/User"}}
213
+ },
215
214
}
216
215
217
216
:param dict|str data: either a parameter or response dictionary that may
@@ -241,10 +240,10 @@ def resolve_schema_dict(self, schema):
241
240
242
241
Example: ::
243
242
244
- #Input
243
+ # Input
245
244
"PetSchema"
246
245
247
- #Output
246
+ # Output
248
247
{"$ref": "#/components/schemas/Pet"}
249
248
250
249
If the input is a dictionary representation of an OpenAPI Schema Object
@@ -255,22 +254,22 @@ def resolve_schema_dict(self, schema):
255
254
256
255
Examples: ::
257
256
258
- #Input
257
+ # Input
259
258
{"type": "array", "items": "PetSchema"}
260
259
261
- #Output
260
+ # Output
262
261
{"type": "array", "items": {"$ref": "#/components/schemas/Pet"}}
263
262
264
- #Input
263
+ # Input
265
264
{"type": "object", "properties": {"pet": "PetSchcema", "user": "UserSchema"}}
266
265
267
- #Output
266
+ # Output
268
267
{
269
268
"type": "object",
270
269
"properties": {
271
270
"pet": {"$ref": "#/components/schemas/Pet"},
272
- "user": {"$ref": "#/components/schemas/User"}
273
- }
271
+ "user": {"$ref": "#/components/schemas/User"},
272
+ },
274
273
}
275
274
276
275
:param string|Schema|dict schema: the schema to resolve.
0 commit comments