Bier.OpenAPI.Types (bier v0.1.0)

Copy Markdown View Source

PostgreSQL type -> Swagger 2.0 schema mapping (mirrors PostgREST OpenAPI.hs:59-115).

Two modes: schema/2 for column/definition/body properties, query_param/2 for RPC GET query parameters (arrays/json collapse to string).

Summary

Functions

Decode a column default expression to a JSON value, or :omit when there is none.

Query-param mode mapping (RPC GET parameters).

Schema-mode mapping (definition properties, RPC POST body properties).

Functions

default(raw, type)

Decode a column default expression to a JSON value, or :omit when there is none.

query_param(type, opts)

Query-param mode mapping (RPC GET parameters).

schema(type, opts)

Schema-mode mapping (definition properties, RPC POST body properties).