[Bug] supporting json array in request body
See original GitHub issueWhen I try to send an array as a request body, I get an exception.
def request_validation(self, request, query, json, headers, cookies):
req_query = request.args or {}
if request.mimetype in self.FORM_MIMETYPE:
req_json = request.form or {}
if request.files:
req_json = dict(
list(request.form.items()) + list(request.files.items())
)
else:
req_json = request.get_json(silent=True) or {}
req_headers = request.headers or {}
req_cookies = request.cookies or {}
request.context = Context(
query.parse_obj(req_query.items()) if query else None,
> json.parse_obj(req_json.items()) if json else None,
headers.parse_obj(req_headers.items()) if headers else None,
cookies.parse_obj(req_cookies.items()) if cookies else None,
)
E AttributeError: 'list' object has no attribute 'items'
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (12 by maintainers)
Top Results From Across the Web
Android Volley, JsonObjectRequest but receiving JsonArray
I don't think there will be any problem in creating JsonArrayRequest and sending jsonarray as request body because request body always goes as...
Read more >Test runner - set array from json data to request body not ...
windupurnomo commented on Apr 13, 2018. I have an issue when using runner and json file contains array. I got error: "Data file ......
Read more >POST request is failing with error 12905 for a JSON array.
POST request is failing with error 12905 for a JSON array. DEFINE VARIABLE oRequest AS IHttpRequest NO-UNDO. DEFINE VARIABLE oURI AS URI ...
Read more >JSON request body with Arrays - Integrations
The request body has arrays and therefore used "[" and "]" where applicable. But it throws an error that "Invalid Symbol found(open_bracket)". Created...
Read more >How To Create A JSON Request With More Than One Array ...
Hi,I am using the postURL functionality. JSON Request body contains more than one array element like shown below,Original JSON Request Body Format To...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see. I forget JSON body can be a list and
pydantic
supports__root__
.Will fix this. Thanks.
This one is related to PyPy support caused bugs.