Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rest_framework/schemas/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def _get_request_body(self, path, method):

content = self._map_serializer(serializer)
# No required fields for PATCH
if method == 'PATCH':
if method == 'PATCH' and 'required' in content:
del content['required']
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if method == 'PATCH':
    content.pop('required', None)

# No read_only fields for request.
for name, schema in content['properties'].copy().items():
Expand Down