spidermon icon indicating copy to clipboard operation
spidermon copied to clipboard

Change format of content of _validation field

Open rennerocha opened this issue 2 years ago • 1 comments

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.

rennerocha avatar Oct 25 '23 23:10 rennerocha

Can I take this issue? I have created this pull request #431.

rochamatcomp avatar Feb 08 '24 02:02 rochamatcomp