Skip to content

using validator DefaultsJSONRequestBodyValidator with more content-length breaks json data #1954

@mfmarche

Description

@mfmarche

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\:"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions