Skip to content

fix double json (de)serialisation

Yannick requested to merge bug/chunking_json_422 into master

There was a double json deserialisation in chunking feature when dealing with json format. In in case on json format, it did that:

content = await request.json()
return DataframeSerializer.read_json(content, orient)

both line did a json deserialisation. Fix done by directly getting raw body from the request await request.body() instead of await request.json()

Unfortunately there was also a double serialisation in the tests as well hidding this bug. Tests are doing stuff like that:, json=chunk_dataframe.to_json(orient='split'))

chunk_dataframe.to_json performs a first json serialisation. But passing data using 'json' keyword in the post method performs also a json serialisation. Fix by using 'data' instead:, data=chunk_dataframe.to_json(orient='split'))
Edited by Yannick

Merge request reports