Getting StartedQuick Start

Requirements

Install the latest NodeJS LTS release, though any recent version of NodeJS will likely work.

You can check the version we develop and test against here.

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 instead of openapi3 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

Server Scaffolding Templates

Client SDK Templates