-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
ModelSerializer generate ChoicesField will discard default parameter #7469
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
Comments
you can use the |
Potential fix here: #8002 Instead of putting the |
Fix encode#7469. Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
Fix encode#7469. Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
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. |
Fix encode#7469. Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
* Propagate 'default' from model_field to serializer field Fix #7469. Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com> * updated field default on serializer according to openapi generation and added that to options action response * added notes regarding default value propagation from model to serializer field * updated note * Update docs/api-guide/fields.md * Update docs/api-guide/fields.md * Update docs/api-guide/fields.md * Update docs/api-guide/fields.md * Update docs/api-guide/fields.md * Update docs/api-guide/fields.md --------- Co-authored-by: John Parton <john.parton.iv@gmail.com> Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com> Co-authored-by: Rizwan Shaikh <rshaikh@ces-ltd.com> Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
model
Serializer
swagger

So i find
default parameter not in valid_kwargs and will pop, but default in field_kwargs['field_kwargs']
I rewrite
swagger

The text was updated successfully, but these errors were encountered: