Skip to content

Error "is not valid under any of the given schemas" also if json schema validator is fine #350

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

Closed
njordr opened this issue Aug 8, 2017 · 1 comment

Comments

@njordr
Copy link

njordr commented Aug 8, 2017

Hi.

Using the schema and the json attached, I've got this error:

{'type': 'object', 'properties': {'code': {'type': 'string'}, 'ci': {'type': 'object', 'properties': {'network': {'type': 'object', 'properties': {'subnet_blocks': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'firstip': {'type': 'string'}, 'lastip': {'type': 'string'}, 'subnets': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'ip': {'type': 'string'}, 'mask': {'type': 'string'}, 'ips': {'type': 'array', 'items': {'type': 'object', 'properties': {'ip': {'type': 'string'}}, 'required': ['ip']}}}, 'required': ['name', 'ip', 'mask']}}}, 'required': ['name', 'firstip', 'lastip']}}}, 'required': ['subnet_blocks']}, 'data_center': {'type': 'object', 'properties': {'racks': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'org_id': {'type': 'string'}, 'status': {'type': 'string'}, 'location': {'type': 'string'}, 'brand_id': {'type': 'string'}, 'model_id': {'type': 'string'}, 'enclosures': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'org_id': {'type': 'string'}, 'status': {'type': 'string'}, 'location': {'type': 'string'}, 'brand_id': {'type': 'string'}, 'model_id': {'type': 'string'}, 'servers': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'status': {'type': 'string'}, 'location': {'type': 'string'}, 'brand_id': {'type': 'string'}, 'model_id': {'type': 'string'}, 'osfamily_id': {'type': 'string'}, 'osversion_id': {'type': 'string'}, 'managementip_id': {'type': 'string'}}, 'required': ['name', 'managementip_id']}}, 'storages': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'status': {'type': 'string'}, 'location': {'type': 'string'}, 'brand_id': {'type': 'string'}, 'model_id': {'type': 'string'}, 'managementip_id': {'type': 'string'}}, 'required': ['name']}}}, 'required': ['name', 'org_id']}}}, 'required': ['name', 'org_id']}}}, 'required': ['racks']}, 'farms': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'status': {'type': 'string'}, 'hypervisors': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'status': {'type': 'string'}, 'server': {'type': 'string'}}, 'required': ['name', 'server']}}}, 'required': ['name', 'hypervisors']}}}, 'required': []}}, 'required': ['code', 'ci']} is not valid under any of the given schemas

I tried to verify them here: http://www.jsonschemavalidator.net/ and no issues arise.

Please help
jsonschema_input_json.txt
jsonschema_schema.txt
jsonschema_validation_error.txt

@Julian
Copy link
Member

Julian commented Aug 20, 2017

Hi!

Please try to use this issue tracker for bugs / features, rather than general support.

There's a mailing list, or the specification also has a mailing list with a much larger audience, who should be able to point out the problem.

In your specific case, it's telling you that the ['properties']['orgs']['items'] part of your schema itself is not a valid schema, and it needs to be. On that exception object will be a context attribute which will contain more specific information about why it's not a valid schema. http://python-jsonschema.readthedocs.io/en/latest/errors/ has more details.

Hopefully that helps.

@Julian Julian closed this as completed Aug 20, 2017
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

No branches or pull requests

2 participants