Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Partial serializer should not have required fields (OpenAPI)#7563

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
auvipy merged 2 commits intoencode:masterfromdenisorehovsky:fix-partial-serializers
Aug 13, 2023

Conversation

@denisorehovsky
Copy link
Contributor

No description provided.

@adamchainz
Copy link
Contributor

Plaese provide more explanation of this issue - e.g. a link to the relevant decsription in the Open API spec, what issues you're facing, ...

@denisorehovsky
Copy link
ContributorAuthor

@adamchainz Hi, Adam. Here's the problem. Let's say we have this serializer:

class ExampleSerializer(serializers.Serializer):    field_a = serializers.CharField()    field_b = serializers.CharField()

And a ViewSet:

class ExampleViewSet:    serializer_class = ExampleSerializer    def partial_update(self, ...):        pass

Since the request is partial, all the fields are not required. In a request body, we can send:

  • Only field_a
  • Only field_b
  • Both field_a and field_b

And it should work. However, DRF's OpenAPI generated documentation will show that both field_a and field_b are required, even though they're not.

@stale
Copy link

stalebot commentedMay 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stalebot commentedAug 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stalestalebot added the stale labelAug 12, 2022
@denisorehovsky
Copy link
ContributorAuthor

@adamchainz So what do you think?

@stalestalebot removed the stale labelOct 16, 2022
@stale
Copy link

stalebot commentedDec 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stalestalebot added the stale labelDec 16, 2022
Copy link
Collaborator

@auvipyauvipy left a comment

Choose a reason for hiding this comment

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

it is a very small change so if you could rebase we can consider accepting this. otherwise will close

@stalestalebot removed the stale labelDec 16, 2022
@auvipy
Copy link
Collaborator

can you please share the relevant part of the spec to verify?

@stale
Copy link

stalebot commentedFeb 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stalestalebot added the stale labelFeb 18, 2023
@auvipyauvipy removed the stale labelFeb 18, 2023
@auvipyauvipy requested a review fromtfranzelMay 18, 2023 03:44
@stale
Copy link

stalebot commentedAug 12, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stalestalebot added the stale labelAug 12, 2023
@auvipyauvipy merged commitda92888 intoencode:masterAug 13, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@auvipyauvipyauvipy approved these changes

@tfranzeltfranzelAwaiting requested review from tfranzel

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@denisorehovsky@adamchainz@auvipy@lovelydinosaur

[8]ページ先頭

©2009-2025 Movatter.jp