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 68 commits into
base: master
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

WasinTh and others added 30 commits August 25, 2019 13:36
`permission_classes` expects tuple but list was provided
fix a bug: url from swagger_settings.DEFAULT_API_URL is not working
This change fixes an `OPTIONS` request to the API page which will return
a successful response, but the `TemplateHTMLRender` will not be prepared
to render it since there is no template name provided in either the view
or response [1].

[1]: https://github.com/encode/django-rest-framework/blob/f0a5b958a134e8cd94e3ef3263e8fa623ac9b82f/rest_framework/renderers.py#L178-L189
Add utf-8 support for generated formats
Remove universal wheel, python 2 is unsupported
JoelLefkowitz and others added 23 commits July 18, 2022 13:35
Add prepublish compatibility checks, a composite installation action and explicitly set tox targets
…ering-with-TemplateHTMLRenderer

handle errors rendering with TemplateHTMLRenderer
…one-field

add support for working with pytz object field
Add checker for allow_null attr
This commit will make sure that `Django :: 3.2` will show up in the
classifiers list on PyPI: https://pypi.org/project/drf-yasg/

(The magic happens because we parse the README to get supported Django):
https://github.com/DavidCain/drf-yasg/blob/ee29412d3cdb311/setup.py#L36

3.2 support should already exist
================================
A closed pull request, axnsan12#735,
noted support for Django 3.2 in both `tox.ini`, and the README.

That PR was closed in favor of
axnsan12#741, which edited `tox.ini`
and switched to GitHub Actions.

axnsan12#735 (comment)

This project has been testing on Django 3.2 for a long time (about a
year). I think we can declare it supported it the README!
On `zsh` (a popular shell, and the default for macOS), install fails:

    $ pip install -U -e .[validation]
    zsh: no matches found: .[validation]

Quote the arguments so that `bash` or `zsh` will succeed.
Declare Django 3.2 support in README, classifiers
Fix `pip install` command for contributors on zsh
…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.

@JoelLefkowitz JoelLefkowitz deleted the branch axnsan12:master October 17, 2024 11:55
@JoelLefkowitz JoelLefkowitz reopened this Oct 17, 2024
@JoelLefkowitz JoelLefkowitz changed the base branch from 1.21.x to master October 17, 2024 12:02
@JoelLefkowitz JoelLefkowitz added 1.23.x Release target in 1.23.x bug Bug report/fix labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.23.x Release target in 1.23.x bug Bug report/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.