django-ninja
django-ninja copied to clipboard
Adding create_response method to class Router
The class Router
does not have the method create_response
attached to it, which is not consistent with the behavior of the main class NinjaAPI
. As such, I have added this method in the following pull request, and documented it under Routers in the documentation.
I also changed the default HTTP status-code of the method create_response
to 200 in both Router
and NinjaAPI
, so that the method can be called without error if the parameter status
is not defined.
Other changes came from reformatting using make lint
.
After doing a coverage test on the app, 99.37% of the app is covered, however this 0.63% seems to be from a skipped test from pre-commit, and it seems that this modification is both stable and passing, both with custom app testing, and unit testing.
@vitalik does this look good? just asking