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

Coerce types only in uri parser #1627

Merged
merged 2 commits into from
Jan 30, 2023
Merged

Coerce types only in uri parser #1627

merged 2 commits into from
Jan 30, 2023

Conversation

RobbeSneyders
Copy link
Member

This PR moves all type coercing into the URI parsers and makes sure it's only done once for each code path.

@RobbeSneyders RobbeSneyders added this to the Connexion 3.0 milestone Jan 26, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build 4016008934

  • 28 of 28 (100.0%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.009%) to 90.14%

Files with Coverage Reduction New Missed Lines %
connexion/exceptions.py 2 93.33%
Totals Coverage Status
Change from base Build 4015910556: 0.009%
Covered Lines: 3099
Relevant Lines: 3438

💛 - Coveralls

def _validate_strictly(self, data: FormData) -> None:
form_params = data.keys()
spec_params = self.schema.get("properties", {}).keys()
errors = set(form_params).difference(set(spec_params))
Copy link
Member

@Ruwann Ruwann Jan 28, 2023

Choose a reason for hiding this comment

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

Not directly related to this PR, but is the set conversion actually needed here? Doesn't the keyview support set operations directly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Only via bitwise operations. So form_params - set(spec_params) would work and I guess that's easier to understand. I'll do it in a separate PR though, since I'm afraid the pipeline on this PR would start failing due to an issue for which I already included a fix in #1628.

@RobbeSneyders RobbeSneyders merged commit 022bb8f into main Jan 30, 2023
@RobbeSneyders RobbeSneyders deleted the feature/uri-parsing branch January 30, 2023 07:49
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.

None yet

3 participants