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

TypeError for simple object schema with additionalProperties=false #169

Open
bdziendzik opened this issue Apr 25, 2017 · 0 comments
Open
Labels

Comments

@bdziendzik
Copy link

Running validation for a schema like:

{
"main": {
              "enum": [
                "duck",
                "chicken",
                "beef"
              ],
              "type": "string",
              "additionalProperties": false,
              "description": "Status of current or last loan."
            }
}

will raise

...
File "/Users/bartosz/.virtualenvs/django/lib/python2.7/site-packages/flex/validation/common.py", line 384, in validate_object
    schema_validators = construct_schema_validators(schema, context)
  File "/Users/bartosz/.virtualenvs/django/lib/python2.7/site-packages/flex/validation/schema.py", line 230, in construct_schema_validators
    generate_additional_properties_validator(context=context, **schema),
TypeError: generate_additional_properties_validator() takes exactly 2 arguments (1 given)

The generate_additional_properties_validator is called if schema.get('additionalProperties') is False is met and it expects properties of the schema to be passed but there is no properties in string field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants