Requirements
Install the latest NodeJS LTS release (opens in a new tab), though any recent version of NodeJS will likely work.
You can check the version we develop and test against here (opens in a new tab).
Installation
Install the cli
First we must install the cli package. It's recommended to install this as a devDependency
in each project that
depends on it, though you could also install it globally if you prefer.
npm i -D @nahkies/openapi-code-generator
(Optional) For typespec support
If you want to use typespec (opens in a new tab) instead of openapi3 (opens in a new tab) as your input specifications, additionally install the typespec compiler and supporting packages.
npm i -D @typespec/compiler @typespec/http @typespec/openapi @typespec/openapi3 @typespec/versioning
Depending how your typespec specification is written, you may find you need to install additional packages such
as @typespec/rest
.
Follow the instructions for the desired template
Each template has it's own dependency requirements. Please see the specific guides linked below