starmallow 0.3.7__py3-none-any.whl → 0.3.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- starmallow/__init__.py +1 -1
- starmallow/request_resolver.py +6 -6
- starmallow/routing.py +7 -2
- {starmallow-0.3.7.dist-info → starmallow-0.3.9.dist-info}/METADATA +1 -1
- {starmallow-0.3.7.dist-info → starmallow-0.3.9.dist-info}/RECORD +7 -7
- {starmallow-0.3.7.dist-info → starmallow-0.3.9.dist-info}/WHEEL +0 -0
- {starmallow-0.3.7.dist-info → starmallow-0.3.9.dist-info}/licenses/LICENSE.md +0 -0
starmallow/__init__.py
CHANGED
starmallow/request_resolver.py
CHANGED
@@ -223,7 +223,7 @@ async def resolve_subparams(
|
|
223
223
|
values[param_name] = dependency_cache[resolved_param.cache_key]
|
224
224
|
continue
|
225
225
|
|
226
|
-
resolver_kwargs, resolver_errors, _ = await resolve_params(
|
226
|
+
resolver_kwargs, resolver_errors, _, _ = await resolve_params(
|
227
227
|
request=request,
|
228
228
|
background_tasks=background_tasks,
|
229
229
|
response=response,
|
@@ -249,7 +249,7 @@ async def resolve_params(
|
|
249
249
|
background_tasks: Optional[BackgroundTasks] = None,
|
250
250
|
response: Optional[Response] = None,
|
251
251
|
dependency_cache: Optional[Dict[Tuple[Callable[..., Any], Tuple[str]], Any]] = None,
|
252
|
-
) -> Tuple[Dict[str, Any], Dict[str, Union[Any, List, Dict]], BackgroundTasks]:
|
252
|
+
) -> Tuple[Dict[str, Any], Dict[str, Union[Any, List, Dict]], BackgroundTasks, Response]:
|
253
253
|
dependency_cache = dependency_cache or {}
|
254
254
|
|
255
255
|
if response is None:
|
@@ -269,7 +269,7 @@ async def resolve_params(
|
|
269
269
|
dependency_cache=dependency_cache,
|
270
270
|
)
|
271
271
|
if errors:
|
272
|
-
return None, errors, background_tasks
|
272
|
+
return None, errors, background_tasks, response
|
273
273
|
|
274
274
|
arg_values, errors = await resolve_basic_args(
|
275
275
|
request,
|
@@ -278,7 +278,7 @@ async def resolve_params(
|
|
278
278
|
params,
|
279
279
|
)
|
280
280
|
if errors:
|
281
|
-
return None, errors, background_tasks
|
281
|
+
return None, errors, background_tasks, response
|
282
282
|
|
283
283
|
resolved_values, errors = await resolve_subparams(
|
284
284
|
request,
|
@@ -288,10 +288,10 @@ async def resolve_params(
|
|
288
288
|
dependency_cache=dependency_cache,
|
289
289
|
)
|
290
290
|
if errors:
|
291
|
-
return None, errors, background_tasks
|
291
|
+
return None, errors, background_tasks, response
|
292
292
|
|
293
293
|
return {
|
294
294
|
**security_values,
|
295
295
|
**arg_values,
|
296
296
|
**resolved_values,
|
297
|
-
}, {}, background_tasks
|
297
|
+
}, {}, background_tasks, response
|
starmallow/routing.py
CHANGED
@@ -75,7 +75,7 @@ def get_request_handler(
|
|
75
75
|
assert endpoint_model.call is not None, "dependant.call must be a function"
|
76
76
|
|
77
77
|
async def app(request: Request) -> Response:
|
78
|
-
values, errors, background_tasks = await resolve_params(request, endpoint_model.params)
|
78
|
+
values, errors, background_tasks, sub_response = await resolve_params(request, endpoint_model.params)
|
79
79
|
|
80
80
|
if errors:
|
81
81
|
raise RequestValidationError(errors)
|
@@ -98,8 +98,13 @@ def get_request_handler(
|
|
98
98
|
response_args: Dict[str, Any] = {"background": background_tasks}
|
99
99
|
if endpoint_model.status_code is not None:
|
100
100
|
response_args["status_code"] = endpoint_model.status_code
|
101
|
+
if sub_response.status_code:
|
102
|
+
response_args["status_code"] = sub_response.status_code
|
101
103
|
|
102
104
|
response = endpoint_model.response_class(response_data, **response_args)
|
105
|
+
if not is_body_allowed_for_status_code(response.status_code):
|
106
|
+
response.body = b""
|
107
|
+
response.headers.raw.extend(sub_response.headers.raw)
|
103
108
|
|
104
109
|
return response
|
105
110
|
|
@@ -112,7 +117,7 @@ def get_websocker_hander(
|
|
112
117
|
assert endpoint_model.call is not None, "dependant.call must be a function"
|
113
118
|
|
114
119
|
async def app(websocket: WebSocket) -> None:
|
115
|
-
values, errors = await resolve_params(websocket, endpoint_model.params)
|
120
|
+
values, errors, _, _ = await resolve_params(websocket, endpoint_model.params)
|
116
121
|
|
117
122
|
if errors:
|
118
123
|
await websocket.close(code=WS_1008_POLICY_VIOLATION)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
starmallow/__init__.py,sha256=
|
1
|
+
starmallow/__init__.py,sha256=qxUolB3Gs6F-zlmlo45q_n51vgxqvj4J0kYDV9Rd2CE,322
|
2
2
|
starmallow/applications.py,sha256=oZxxLof82QdfK44-q6wUHq9z8_sRGSEVzSQkNvfGKIg,29708
|
3
3
|
starmallow/concurrency.py,sha256=MVRjo4Vqss_yqhaoeVt3xb7rLaSuAq_q9uYgTwbsojE,1375
|
4
4
|
starmallow/constants.py,sha256=u0h8cJKhJY0oIZqzr7wpEZG2bPLrw5FroMnn3d8KBNQ,129
|
@@ -13,9 +13,9 @@ starmallow/exception_handlers.py,sha256=gr2qLYWEtsIEH28n7OreEiiLVz6Y7b6osRyS9esJ
|
|
13
13
|
starmallow/exceptions.py,sha256=vabtPJkTmtCdC8_2OPBE8Osz0v0KxaSOX6IWf1jgNkc,872
|
14
14
|
starmallow/fields.py,sha256=arrTabCYoJFZcoY69EZTBH3YUg7CUSr3-zYLiAjYLTM,1238
|
15
15
|
starmallow/params.py,sha256=-f6ut1p_w_I8lyEgRciJxUtHmoVXKAD2Ug4KuRjPlJA,8661
|
16
|
-
starmallow/request_resolver.py,sha256=
|
16
|
+
starmallow/request_resolver.py,sha256=kT7B0BWSqBP_9Jl865Ya_Op9I3W4FyfBxXjvtucWT_0,10785
|
17
17
|
starmallow/responses.py,sha256=k2pf_m21ykf_FECdODUz400pMucMJJf_Zm8TXFujvaU,2012
|
18
|
-
starmallow/routing.py,sha256=
|
18
|
+
starmallow/routing.py,sha256=sy7wbWc20zDjxo5CIR4j1VXlyKsan6i8zPpql0RFrNw,39203
|
19
19
|
starmallow/schema_generator.py,sha256=BKtXVQoNFWoAIEtiRNylWls_7nyFIshy3_myooogjoI,17806
|
20
20
|
starmallow/serializers.py,sha256=rBEKMNgONgz_bai12uDvAEMCI_aEFGsqMSeIoWtlrOI,12514
|
21
21
|
starmallow/types.py,sha256=8GXWjvzXQhF5NMHf14fbid6uErxVd1Xk_w2I4FoUgZ4,717
|
@@ -33,7 +33,7 @@ starmallow/security/http.py,sha256=cpGjM1kFDq3i_bOY96kMkf4cspBUxFkkET9lTK3NA-0,6
|
|
33
33
|
starmallow/security/oauth2.py,sha256=1nv1580PY4cwgu5gzpQCf2MfMNv2Cfv05753AUHPOhQ,10005
|
34
34
|
starmallow/security/open_id_connect_url.py,sha256=IPsL2YzWc2mPwJbrUn6oFRTi7uRAG6mR62CGwmzBs1k,1399
|
35
35
|
starmallow/security/utils.py,sha256=bd8T0YM7UQD5ATKucr1bNtAvz_Y3__dVNAv5UebiPvc,293
|
36
|
-
starmallow-0.3.
|
37
|
-
starmallow-0.3.
|
38
|
-
starmallow-0.3.
|
39
|
-
starmallow-0.3.
|
36
|
+
starmallow-0.3.9.dist-info/METADATA,sha256=SFjwx09PtLdQKW40bKWwSIuYobGkUGuav6EVvWBoxIk,5651
|
37
|
+
starmallow-0.3.9.dist-info/WHEEL,sha256=y1bSCq4r5i4nMmpXeUJMqs3ipKvkZObrIXSvJHm1qCI,87
|
38
|
+
starmallow-0.3.9.dist-info/licenses/LICENSE.md,sha256=QelyGgOzch8CXzy6HrYwHh7nmj0rlWkDA0YzmZ3CPaY,1084
|
39
|
+
starmallow-0.3.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|