vitalik / django-ninja

💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
https://django-ninja.dev
MIT License
7.28k stars 432 forks source link

Operation default options, addresses #1267 #1268

Closed Ksauder closed 2 months ago

Ksauder commented 3 months ago

Fairly simple change to the Router to allow a set of operation options to be set for every operation on the router.

1267

I picked 4 options: by_alias, exclude_unset, exclude_defaults, and exclude_none since they seemed ripe for this, but this could be expanded.

I did not tackle any sort of inheritance in this PR. Adding a Router to a Router that has defaults won't cause the default options to percolate.