Skip to content

CourtAPI/docker-openapi-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

docker-openapi-typescript

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.

Usage

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.ts

Remote schema

A 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.ts

Show CLI help

docker run --rm courtapi/openapi-typescript:7.13.0 --help

Building & publishing

The image tag tracks the bundled openapi-typescript version, which is passed in at build time via the version variable:

make publish version=7.13.0

This 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 .

About

Docker image to run openapi-typescript

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors