Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Improve API data validation in serializers #104

Closed
mertakozcan opened this issue Oct 28, 2018 · 6 comments
Closed

Improve API data validation in serializers #104

mertakozcan opened this issue Oct 28, 2018 · 6 comments

Comments

@mertakozcan
Copy link
Contributor

During create or update process of serializers, sometimes KeyError occurs and currently, we aren't handling them. We can implement validations to check if required fields are present and if there is a problem, we can raise serializers.ValidationError and this returns a message we specify plus meaningful status code.

@kirbiyik
Copy link
Contributor

Quick question @cerob . Should I have a robust validation on the frontend? If we are going to handle bad input it in the backend, I can just show error message which will ease my load since not much left to the milestone.

@cerob
Copy link
Member

cerob commented Oct 29, 2018

@kirbiyik That makes your tasks easier and yes, we can do this. :)

@cerob
Copy link
Member

cerob commented Oct 29, 2018

I think we can add required attribute so it raises an error during validation.

@cerob
Copy link
Member

cerob commented Oct 29, 2018

I am making some of the fields optional according to principles that we have been talking in #99

@kirbiyik
Copy link
Contributor

I think we should go all or none. Otherwise recommendation and search might be troublesome due to gaps in data.

@cerob
Copy link
Member

cerob commented Nov 6, 2018

This step is done. There are no KeyErrors anymore. We will be continuing different aspects of validation problems on issue #118

@cerob cerob closed this as completed Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants