mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 08:59:54 +03:00
Add a check for 'required' before deletion
This commit is contained in:
parent
89ac0a1c7e
commit
30c91a6aef
|
@ -462,7 +462,7 @@ class AutoSchema(ViewInspector):
|
|||
|
||||
content = self._map_serializer(serializer)
|
||||
# No required fields for PATCH
|
||||
if method == 'PATCH':
|
||||
if method == 'PATCH' and content.get('required'):
|
||||
del content['required']
|
||||
# No read_only fields for request.
|
||||
for name, schema in content['properties'].copy().items():
|
||||
|
|
Loading…
Reference in New Issue
Block a user