Skip to content

Commit

Permalink
move require_data kwarg to end of parameter list
Browse files Browse the repository at this point in the history
So that calls to validate() passing positional arguments
continue to work.
  • Loading branch information
cesarferradas committed Sep 26, 2019
1 parent 0cab804 commit 22eb517
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flasgger/utils.py
Expand Up @@ -288,9 +288,9 @@ def __replace_ref(schema, relative_path):


def validate(
data=None, require_data=True, schema_id=None, filepath=None,
root=None, definition=None, specs=None, validation_function=None,
validation_error_handler=None):
data=None, schema_id=None, filepath=None, root=None, definition=None,
specs=None, validation_function=None, validation_error_handler=None,
require_data=True):
"""
This method is available to use YAML swagger definitions file
or specs (dict or object) to validate data against its jsonschema.
Expand All @@ -300,7 +300,6 @@ def validate(
validate(request.json, 'User', specs={'definitions': {'User': ...}})
:param data: data to validate, by default is request.json
:param require_data: is the data param required?
:param schema_id: The definition id to use to validate (from specs)
:param filepath: definition filepath to load specs
:param root: root folder (inferred if not provided), unused if path
Expand All @@ -316,6 +315,7 @@ def validate(
exceptions thrown when validating which takes the exception
thrown as the first, the data being validated as the second and
the schema being used to validate as the third argument
:param require_data: is the data param required?
"""
schema_id = schema_id or definition

Expand Down

0 comments on commit 22eb517

Please sign in to comment.