Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce required RequestBody #1652

Merged
merged 1 commit into from
Feb 25, 2023
Merged

Conversation

RobbeSneyders
Copy link
Member

Fixes #878
Fixes #1317

@RobbeSneyders RobbeSneyders added this to the Connexion 3.0 milestone Feb 24, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build 4265010094

  • -4 of 56 (92.86%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 92.329%

Changes Missing Coverage Covered Lines Changed/Added Lines %
connexion/operations/swagger2.py 20 21 95.24%
connexion/validators/form_data.py 7 8 87.5%
connexion/validators/json.py 10 12 83.33%
Totals Coverage Status
Change from base Build 4247925101: -0.04%
Covered Lines: 3274
Relevant Lines: 3546

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4265010094

  • 52 of 56 (92.86%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 92.329%

Changes Missing Coverage Covered Lines Changed/Added Lines %
connexion/operations/swagger2.py 20 21 95.24%
connexion/validators/form_data.py 7 8 87.5%
connexion/validators/json.py 10 12 83.33%
Totals Coverage Status
Change from base Build 4247925101: -0.04%
Covered Lines: 3274
Relevant Lines: 3546

💛 - Coveralls

Copy link
Member

@Ruwann Ruwann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left a comment on some duplicate code

self.headers = Headers(scope=scope)
self.check_empty()

def check_empty(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not ideal to have this duplicate code, but still it seems to be better than factoring this out in a common function or class

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on a base request body validator class that will solve this :)

Will submit as a new PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, curious to see what that looks like and how much it can cover

@RobbeSneyders RobbeSneyders merged commit 969c146 into main Feb 25, 2023
@RobbeSneyders RobbeSneyders deleted the feature/required-request-body branch February 25, 2023 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

required: false in POST body not honored? I think? requestBody: required: true doesn't work
3 participants