-
-
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 <[email protected]>
Fix encode#7469. Co-authored-by: Nikhil Benesch <[email protected]>
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 <[email protected]>
* Propagate 'default' from model_field to serializer field Fix #7469. Co-authored-by: Nikhil Benesch <[email protected]> * 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 <[email protected]> Co-authored-by: Nikhil Benesch <[email protected]> Co-authored-by: Rizwan Shaikh <[email protected]> Co-authored-by: Asif Saif Uddin <[email protected]>
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: