Default values for parameters in API Browser
Talkless opened this issue · comments
If we have rather complex JSON-RPC call with lot's of even more complex parameters, it would be convenient to have ability to auto-fill example parameters in this form:
This would make new/outsourced developers to become familiar with API easier.
Not sure where these defaults could be placed... Maybe Angular could try to fetch functionname.defaults.json file, and if it exists, fill it's contents. Or maybe view decorator to bridge documentation with some more detailed description object?
I would like to use the Browser annotation instead of using the method's default parameter, because sometimes we don't want to have a default parameter, but we want to have a default Browser documentation parameter.
Something like that: https://drf-spectacular.readthedocs.io/en/latest/readme.html#customization-by-using-extend-schema
because sometimes we don't want to have a default parameter
Yes, good point. I'd say most of the time...
Defaults could be shown in the signatures in the Browser, but that's probably for other issue, but the examples should be specifically crafted, with all values specified (default or not).
Defaults could be shown in the signatures in the Browser, but that's probably for other issue, but the examples should be specifically crafted, with all values specified (default or not).
I agree with that!