Skip to content

Change format of content of _validation field #425

@rennerocha

Description

@rennerocha

If a validation error is found and SPIDERMON_VALIDATION_ADD_ERRORS_TO_ITEMS setting is True, we populate the _validation field with the errors.

The content of this field is the string representation of a Python defaultdict such as:
'_validation': defaultdict(<class 'list'>, {'author_url': ['Invalid URL']})

To make this field valid as JSON, we should have it as a list of objects such as:
'_validation': [ {'author_url': ['Invalid URL'] }]

This change will improve the data returned, making it possible to be read as a JSON.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions