OPTIONS could easily return the default of a serializer #8003
Unanswered
john-parton
asked this question in
Ideas & Suggestions
Replies: 1 comment
-
I would really benefit from such a feature for the InvenTree project, as well as #8002 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This only works if you apply this PR/patch: #8002
If you override
rest_framework.metadata.SimpleMetadata
as follows, then you get the field default when you do anOPTIONS
query.Like magic, for every field:
Here's my branch with the fix for missing
default
and the feature to adddefault
to theOPTIONS
request: https://github.com/john-parton/django-rest-framework/tree/feature/include-defaults-in-optionsShould this feature be the default behavior? I would happily submit a PR
Beta Was this translation helpful? Give feedback.
All reactions