scrapinghub / spidermon

Scrapy Extension for monitoring spiders execution.
https://spidermon.readthedocs.io
BSD 3-Clause "New" or "Revised" License
524 stars 94 forks source link

Change format of content of _validation field #425

Closed rennerocha closed 2 months ago

rennerocha commented 8 months ago

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.

rochamatcomp commented 5 months ago

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