[Fixed]-Is it a good practice to use serializer as query parameters validators?

17👍

Definitely a good practice, since the serializer will automatically validate the fields, and raise the right exception if required.

The alternative is to either manually define these validations in the view, or worse – have your APIs return 500 server errors whenever an incorrect input is sent.

Leave a comment