updates to "body" object inside handler also changes flask.request.json
Description
Hello - I've created a repo to demonstrate this possible bug. Here is a link to my repo.
Expected behaviour
Using swagger 2, when one adds an additional key to the "body" object passed in from flask/connexion, it also updates flask.request.json. For example in the output below you'll notice I add the "status" key to the body object, and this is reflected when I use flask.request.json.
I expect the same when I switch to using the swagger 3 file.
Actual behaviour
Using swagger 3, updates to the "body" object does not update the flask.request.json object. Is there something I'm missing to get the same functionality as swagger 2? Or is this a bug in flask or connexion?
Notice in the output below there is no "status" key in the response.
Steps to reproduce
- Clone this repo
- pip install -r requirements.txt
- run: "python app.py"
- Notice the assertion error
Additional info:
Output of the commands:
$ python app.py
------running first round with swagger 2 file-------
this is body in handler: {'description': 'this is new description'}
this is body in secondary function: {'description': 'this is new description', 'status': True}
------running second round with swagger 3 file------
this is body in handler: {'description': 'this is new description'}
this is body in secondary function: {'description': 'this is new description'}
Traceback (most recent call last):
File "app.py", line 89, in
Can we get a resolution on this Please?
The relevant parts of the code base were change completely for Connexion 3 which will be released tomorrow. Feel free to reopen if you still run into the same issue.