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

Support import string in router.add_router #1256

Closed martinsvoboda closed 3 months ago

martinsvoboda commented 3 months ago

Added support for importing nested router with string path. This unifies behaviour with api.add_router:

# api.add_router
api = NinjaAPI()
api.add_router("main", "myproject.app1.router")

# router.add_router
router = Router()
router.add_router("nested", "myproject.app1.nested.router")
vitalik commented 3 months ago

Thank you @martinsvoboda