New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@codegena/oapi3ts-cli

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codegena/oapi3ts-cli

CLI Application API for codegeneration from OAS3

latest
Source
npmnpm
Version
2.1.10-alpha.8
Version published
Weekly downloads
348
-2.25%
Maintainers
1
Weekly downloads
 
Created
Source

CLI Application API for codegeneration from OAS3

This is an experimental library. Now supporting TypeScript data types and model. Also, generating experimental Angular2+ services.

Supporting of other languages and frameworks might be possible in the future.

It's a part of @codegena scope.

See in action: https://codegena-playground.stackblitz.io/ / https://stackblitz.com/edit/codegena-playground.

Using in NodeJS scripts

Install (without optional dependencies):

npm i @codegena/oapi3ts-cli --no-optional

or

yarn add @codegena/oapi3ts-cli --ignore-optional

So you can use @codegena/oapi3ts-cli in NodeJS scripts. For example, lets create update-typings.js script with code:

"use strict";

var cliLib = require('@codegena/oapi3ts-cli');
var cliApp = new cliLib.CliApplication;

cliApp.createTypings();
cliApp.createServices('angular');

Then launch:

node ./update-typings.js --srcPath ./specs/todo-app-spec.json --destPath ./ --separatedFiles true

Class CliApplication will get command line arguments destPath, srcPath and separatedFiles by itself.

CLI arguments

CLI ArgumentDescription
srcPathPath of url of JSON file with OpenAPI3 specification
destPathPath for destination directory
separatedFilesWhether should converted types been saved in separate files, or in single file

Also, you can set some of options for convertor's configuration config via CLI:

OptionDescription
defaultContentTypeDefault content-type contains no prefixes/suffixes in type names.
implicitTypesRefReplacementMode when models that refer to any models via $ref are replacing implicitly even if firsts have names

Keywords

swagger

FAQs

Package last updated on 19 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts