apptension / cra-template-apptension

Set up a modern web app by running one command.
7 stars 2 forks source link

Investigate how to strongly type API #48

Open mikeqcp opened 4 years ago

mikeqcp commented 4 years ago

We should consider options for strongly typing API request body & response formats.

Ideally this should be shared between BE & FE developers in some way, and on FE avaiable i.e. as Typescript interfaces.

mikeqcp commented 4 years ago

One option I can think about when dealing with Django BE is combination of those two tools:

https://www.django-rest-framework.org/api-guide/schemas/ It allows to generate endpoint metadata in openAPI format (including accepted parametrs & responses format)

https://github.com/manifoldco/swagger-to-ts It allows to parse openAPI schema and produces TS interfaces based on them