spec-first/connexion

using validator DefaultsJSONRequestBodyValidator with more content-length breaks json data

mfmarche opened this issue · 0 comments

Description

I ran into this issue when applying the DefaultsJSONRequestBodyValidator on an openapi spec, and where a default was to a body request, and it increaed the length. I noticed that my json body was getting dropped and not making it into the final operation (via the body name).

It seems to me the issue is related to this line of code:

DefaultsJSONRequestBodyValidator

I suspect the actual scope needs to be updated there in place. WIth the copy() being used, its not clear how that would ever actually update the scope. I will have a pull request for this shortly that corrects this behavior.

Expected behaviour

I expect that json body defaults that increase the content-length will still be applied and function correctly.

Actual behaviour

Steps to reproduce

Additional info:

Output of the commands:

  • python --version
  • pip show connexion | grep "^Version\:"