Generate API definitions from OpenAPI YAML specs
Install
cargo install --git ssh://git@github.com/repositive/apigen.git
Rust is required to use this tool. Install Rust with Rustup.
You can only install apigen if you a member of the Repositive Github org. You also need to add your SSH key to ssh-agent for the cargo install
command to work properly.
ssh-add -K ~/.ssh/id_rsa
Usage
apigen ts ./path/to/api.yaml -o ./path/to/output/folder
Output is rendered to a folder at ./path/to/output/folder/
. If the folder (or its parents) don't exist, they will be created. Any other non-target files in the folder will not be overwritten, but it's good practice to keep this folder clean, and untracked by Git.
Development
Setup:
- Install Rust with Rustup
- Install Node with NVM
npm install
Run:
cargo run -- ts /path/to/api.yaml -o ./rendered/typescript
View docs:
cargo doc --open
Build release:
npm pack
Publish to NPM:
npm publish --access public