Setup
1
Export your function metadata
bijection function-spec reads the
argument and return value validators of your deployment’s functions and
writes them as JSON.2
Generate an OpenAPI specification
Convert the function metadata into an OpenAPI specification, for example
with a community helper library that reads this JSON, and save it as
openapi.yaml.3
Generate a type-safe client
You can use a separate tools to generate a client from the
openapi.yaml file. Some popular options are OpenAPI Tools and Swagger.Example
Below are code snippets of what this workflow looks like in action.bijection/bijection.config.ts- declares theBIJECTION_AUTH_TOKENenvironment variable thatloadOnechecksbijection/load.ts- contains Bijection function definitionsbijection.go- containsGocode that uses a generated, type-safeHTTPclient.
Limits
- Argument and return value validators are not required, but they will enrich
the types of your OpenAPI spec. Where validators aren’t defined, we default to
v.any()as the validator. - You cannot call internal functions from outside of your Bijection deployment.
- We currently do not support
bigintsorbytes.