0.1.4 • Published 5 months ago

openapi-ng-generator v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

OpenAPI Angular+Typescript Codegen

Node.js library that generates Angular client (v19) based on V3 OpenAPI specification. Modified and updated from no longer maintained project: https://github.com/ferdikoomen/openapi-typescript-codegen, so big thanks to Ferdi for laying out the foundation! šŸ‘ŒšŸ™Œ

This library has no substantial configs available. There are other libraries out there that take a lot of config parameters, the intention for this library is a minimal, clean output for Angular. This library has been created out of own need and the output given is based on personal preferences.

Install

npm install openapi-ng-generator

Usage

$ openapi-ng-gen

Usage: openapi-ng-gen [options]

Options:

-i, --input <value> OpenAPI specification, can be a path, url or string content (required)
-o, --output <value> Output directory (required)
--useOptions Use options instead of arguments
--useUnionTypes Use union types instead of enums

Example

$ openapi-ng-gen --i ./spec.json --o ./api

Produces:

api/
ā”œā”€ā”€ core/
│   ā”œā”€ā”€ ApiError.ts
│   ā”œā”€ā”€ ApiRequestOptions.ts
│   ā”œā”€ā”€ ApiResult.ts
│   ā”œā”€ā”€ OpenAPI.ts
│   └── request.ts
ā”œā”€ā”€ models/
│   └── models.ts
└── services/
    └── service files with api endpoints