3 ms·
Django Rest Framework + drf-spectacular. It needs a couple tweaks here and there but it's great. Apparently django-ninja (a different REST framework for Django
by arcanemachiner 3y ago
Django Rest Framework + drf-spectacular. It needs a couple tweaks here and there but it's great.
Apparently django-ninja (a different REST framework for Django) also generates an OpenAPI spec but I haven't tried it.
- cachance 3y agoI've also had success with drf + drf-spectacular and then using the output OpenAPI spec to generate a typescript-react client with a third-party code generator. It mostly just works, like you said, and almost acts as a framework guardrail: if the inferred client types are comprehensive and unsurprising then the view tends to be concise; a wonky type indicates there may be something nonstandard in the view that could be fixed by cleaner framework-abiding code.