Sibyx / django_api_forms

Declarative Django request validation for RESTful APIs
https://sibyx.github.io/django_api_forms/
MIT License
22 stars 13 forks source link

Validation refactor #31

Closed Sibyx closed 2 years ago

Sibyx commented 3 years ago

This release has been inspired by Problem Details for HTTP APIs - RFC7807 and blog post Structuring validation errors in REST APIs written by @k3nn7.

The main idea has been to simplify the validation process on the client-side by flattening errors output. To achieve such a goal, the whole validation process has been rewritten (and luckily for us, much simplified). This will be a breaking change and will be released as 1.0.

PR implements DetailedValidationError which inherits from ValidationError and can keep position in lists nested forms. The form will return a linear list of errors instead of a nested dictionary.

ghost commented 3 years ago

CodeSee Review Map:

Review these changes using an interactive CodeSee Map

Review in an interactive map

View more CodeSee Maps

Legend

CodeSee Map Legend