Skip to content

Use OpenAPI schema information to parse types correctly?

Currently parsing types like dates and timestamps is a bit magic. It just attempts to parse any string which could lead to surprising results when some string column happens to contain a date.

While this is rather unlikely and opting out of automagic parsing is possible, it would make more sense for all values of a column to always be of the same type. This type information could potentially be extracted from the OpenAPI schema PostgREST serves.

Related topic: Casting types to custom JSON