Skip to content

on validation error, path to wrong item is false when "anyOf" is used #360

Closed
@xjlm

Description

@xjlm

Hi

when a schema contains a "recursive" structure inside a "anyOf", and there is an error in a related json file deep in the hierarchy, then the validator finds the error but indicates a wrong path:

python check.py

INFO validate file 'data.json' ...
ERROR validate file 'data.json' FAIL
ERROR {u'CONTENT': [{u'CONTENT': [{u'CONTENT': [{u'TYPE': u'CHAPTER', u'TITLE': u'chapter_55555'}], u'TYPE': u'CHAPTER', u'TITLE': u'chapter_4'}], u'TYPE': u'CHAPTER', u'TITLE': u'chapter_3'}], u'TYPE': u'CHAPTER', u'TITLE': u'chapter_2'} is not valid under any of the given schemas *** deque([u'CONTENT', 0, u'CONTENT', 0])

Note that the online validator https://json-schema-validator.herokuapp.com finds many errors but at least indicates the error concerning the string being too long and its path

see attached files schema.json and data.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions