-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since allow_null=True, the serializer can still validate and partially update even though partial=False #9501
Comments
you are passing required=False in FlowSerializer . don't you think you should pass required=True for desired result ? for failing validation ? |
|
Understanding the Behavior:
|
Description:
When using Django’s model and serializer as shown below, the FlowSerializer allows partial updates even when
partial=False
, due toallow_null=True
for the flow_id field.Model:
Serializer:
Input data:
When the input data does not include the flow_id field, the serializer still passes validation, resulting in a partial update. This behavior is unexpected because partial=True is not used.
Source Code Insight:
The relevant code in the Django REST framework source is:
Questions:
This behavior is causing confusion and leads to unintended partial updates. Any insights or clarification on this design choice would be greatly appreciated.
The text was updated successfully, but these errors were encountered: