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

Validate parameter list #225

Merged
merged 4 commits into from
Aug 1, 2016
Merged

Conversation

dsem
Copy link

@dsem dsem commented May 13, 2016

Fixes #223 .

Changes proposed in this pull request:

  • Add logic to validate that the query and formData parameters passed on the request are valid parameters in the swagger spec
  • Add a strict_validation flag to add_api() and Api to enable this validation.

@coveralls
Copy link

coveralls commented May 13, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling aa3faa9 on dsem:validate-parameter-list into 4ab9625 on zalando:master.

@@ -156,8 +167,9 @@ def validate_schema(self, data):


class ParameterValidator(object):
def __init__(self, parameters):
def __init__(self, parameters, strict_validation=False):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a docstring explaining what strict_validation does?

@jmcs
Copy link
Contributor

jmcs commented Jun 1, 2016

Thanks for the Pull Request. The code looks ok but can you also update the documentation?

@LappleApple
Copy link
Contributor

Hi @dsem -- checking in here. Did you update the documentation?

@dsem
Copy link
Author

dsem commented Jul 28, 2016

Sorry, I will mike time for this this weekend. Thanks for reaching out.

Request validation is enhanced to verify requests only include query or
formData parameters that are specified in the spec.

This validation does not occur for header or path parameters.  This is
because most applications probably prefer to ignore extra headers and
a request with extra path parameters would point to a different
endpoint.
@coveralls
Copy link

coveralls commented Aug 1, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling fd69a37 on dsem:validate-parameter-list into 955552d on zalando:master.

@coveralls
Copy link

coveralls commented Aug 1, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 1e7ee40 on dsem:validate-parameter-list into 955552d on zalando:master.

@dsem
Copy link
Author

dsem commented Aug 1, 2016

Thanks, all. I've updated the documentation and resolved merge conflicts.

@jmcs
Copy link
Contributor

jmcs commented Aug 1, 2016

👍

@jmcs jmcs merged commit 614ca3e into spec-first:master Aug 1, 2016
@jmcs
Copy link
Contributor

jmcs commented Aug 1, 2016

Thanks for the Pull Request

@dsem dsem deleted the validate-parameter-list branch September 15, 2018 15:50
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.

5 participants