A minimal Docker image that wraps the openapi-typescript
CLI, which generates TypeScript types from an OpenAPI schema.
The image's ENTRYPOINT is openapi-typescript, so any arguments you pass to
docker run are forwarded straight to the CLI.
Mount your working directory into the container and run it. The CLI reads from a schema file (or URL) and writes the generated types to stdout, so redirect the output to a file:
docker run --rm -v "$PWD:/work" -w /work \
courtapi/openapi-typescript:7.13.0 \
schema.yaml > schema.d.tsA URL works too — no volume mount needed for the input:
docker run --rm courtapi/openapi-typescript:7.13.0 \
https://petstore3.swagger.io/api/v3/openapi.json > petstore.d.tsdocker run --rm courtapi/openapi-typescript:7.13.0 --helpThe image tag tracks the bundled openapi-typescript version, which is passed in
at build time via the version variable:
make publish version=7.13.0This builds courtapi/openapi-typescript:<version> and pushes it. To build
locally without publishing:
docker build --build-arg VERSION=7.13.0 -t courtapi/openapi-typescript:7.13.0 .