Skip to content

instance and type='required' challenges #219

@lwjohnst86

Description

@lwjohnst86

Here, we rewrite jsonpath so that for type="required" errors it ends in the missing field's name. I think that (regardless of having solved the hash problem) this should be matched by rewriting instance for required errors in the same way. Otherwise, we will end up with output like:

# check({"resources": [{"title": "Title"}]}, error=True)

At package.resources[0].name:
|
| name: {'title': 'Title'}
|       ^^^^^^^^^^^^^^^^^^
'name' is a required property

It would be nice if this could happen here and not in _create_issue, but I don't know off the top of my head if that would be problematic for any logic that relies on instance on SchemaErrors.

Originally posted by @martonvago in #208 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions