drf-standardized-errors
drf-standardized-errors copied to clipboard
fix-schema-generation-for-list-dict-fields
Use a pattern to correctly describe the attr value in validation errors in all cases.
Specifically, this fixes the incorrect description of the attr value for list serializers and list/dict fields.
Taking the example of a list serializer with 1 field named my_field. The validation errors for this field will have the attr value set as 0.my_field, 1.my_field, ...
- Previously, the
attrvalue was described with an enum having a single valueINDEX.my_field. - Now, it shows up as a string with the pattern
\d+\.my_fieldand this pattern correctly described the actualattrvalue returned by the API0.my_field,1.my_field, ...