Generating types gives unhelpful type definitions #344
Replies: 2 comments 9 replies
-
Hi, We're heavy postgrest users, and autogenerated and typed client libraries would be amazing. We've been thinking of paying the maintainer of openapi-client-axios to make a similar library specifically for postgrest, would the Supabase team want to join ? |
Beta Was this translation helpful? Give feedback.
-
Hey @talolard - the axios client looks interesting. Our end goal for the type generation will skip the swagger/OpenApi completely though. Instead we will generate it straight from the database - there is too much information lost between the database and the OpenApi spec. This is (one of) the reasons we're building up the postgres-api |
Beta Was this translation helpful? Give feedback.
-
I was very happy to see Supabase's support for generating types based on the schema definition described in the doco.
But when I tried it out, the result was very disappointing.
Give a table defined like this:
The end result is:
I was expecting something more like:
I don't know much about Swagger/OpenAPI, but it seems like the definition being generated from the
/rest/v1/
endpoint doesn't contain the structure of the table objects, for example thewelcome
definition is just:Am I doing something wrong? Is there some config or a flag I need to set to make the swagger endpoint generate more info?
I've attached the full swagger document.
Beta Was this translation helpful? Give feedback.
All reactions