Skip to content

Propagate nullability in ModelSerializer#8116

Merged
lovelydinosaur merged 1 commit intoencode:masterfrom
benesch:nullable-read-only
Aug 6, 2021
Merged

Propagate nullability in ModelSerializer#8116
lovelydinosaur merged 1 commit intoencode:masterfrom
benesch:nullable-read-only

Conversation

@benesch
Copy link
Contributor

@benesch benesch commented Aug 6, 2021

Description

Propagate the nullability of underlying model fields in ModelSerializer
when those fields are marked as read only. This ensures the correct
generation of OpenAPI schemas.

Closes #8041.

cc @canassa @kevin-brown

Propagate the nullability of underlying model fields in ModelSerializer
when those fields are marked as read only. This ensures the correct
generation of OpenAPI schemas.

Fix encode#8041.
@lovelydinosaur
Copy link
Contributor

Great, thanks!

@lovelydinosaur lovelydinosaur merged commit b215375 into encode:master Aug 6, 2021
@benesch benesch deleted the nullable-read-only branch August 6, 2021 13:48
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull request Dec 3, 2022
Propagate the nullability of underlying model fields in ModelSerializer
when those fields are marked as read only. This ensures the correct
generation of OpenAPI schemas.

Fix encode#8041.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

null=True is not respected by AutoSchema when the field is on read_only_fields

2 participants