django-ninja icon indicating copy to clipboard operation
django-ninja copied to clipboard

Adding create_response method to class Router

Open atomtables opened this issue 11 months ago • 1 comments

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.

atomtables avatar Feb 27 '24 01:02 atomtables

@vitalik does this look good? just asking

atomtables avatar May 03 '24 15:05 atomtables