spidermon
spidermon copied to clipboard
Change format of content of _validation field
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.
Can I take this issue? I have created this pull request #431.