1.0.1 • Published 4 years ago
jsspbuilderalpha02 v1.0.1
K2 TypeScript Broker Generator
This is a CLI which can be used to generate a K2 Broker by providing a Swagger v2.0 or OpenAPI v3.0 definition as input.
Features
- Generates a TypeScript code file (index.ts) from a Swagger v2.0 or OpenAPI v3.0 definition file (json format)
- Dynamic flattening of complex objects up to user defined level in describe schema
- Dynamic flattening of returned data for complex objects
Getting Started
This CLI requires Node.js v12.14.1+ to run.
Usage
Clone the K2 JavaScript broker template into a new directory:
git clone https://github.com/K2Documentation/K2Documentation.Samples.JavascriptBroker.Template.git mynewbroker cd mynewbroker
Install K2 Broker dependencies:
npm install
Install the JSSPBuilder CLI:
npm i jsspbuilderalpha02
Copy you swagger/openAPI definition file to the project folder:
copy ..\swaggers\Swagger_jsonplaceholder_users_full_apiv3.json swagger.json
Run the JSSPBuilder CLI:
jsspbuilder
orjsspbuilder --filename=swagger.json --flatten=2 --outputdir=src