Skip to content
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

Hide read_only=True nested serializers from data #824

Open
wants to merge 1 commit into
base: 1.21.x
Choose a base branch
from

Conversation

curiousKonstantin
Copy link

  1. Use "allOf" OpenAPI property to combine $ref object with extra parameters with $ref object
  2. Hide definition from request payload representation if read_only=True argument was provided for a nested serializer
  3. Show "description" for a $ref if "help_text" was provided for a nested serializer

…Only (to hide nested serializer from payload if read_only=True has been set) and description (to show different descriptions for the same ref)
@curiousKonstantin
Copy link
Author

I was annoyed by frontenders constantly ask "Why do you expect an object in payload?" and was frustrated by impossibility to show help_text from nested serializer on swagger schema (because each field meaning need to be explained, separately) so I've made this workaround with allOf property to fix the issues.

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.

None yet

1 participant