From 125212acf75b500b28ef0899223e48974f2dcea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar=20Abalde=20Reyes?= Date: Mon, 13 Jun 2022 16:48:53 +0200 Subject: [PATCH 1/2] #6 Includes license badge in readme files --- README.md | 2 ++ src/README.md | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 46c2e4a..65a3e8b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://github.com/corunet/openapi-nodejs-cli/blob/main/LICENSE) + # OpenAPI NodeJS CLI This generator requires the Node version >=17.7.1 to run properly diff --git a/src/README.md b/src/README.md index c44fe9e..179a16d 100644 --- a/src/README.md +++ b/src/README.md @@ -1,3 +1,5 @@ +[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://github.com/corunet/openapi-nodejs-cli/blob/main/LICENSE) + [Summary](#summary) · [Getting started](#getting-started) · [Support](#support) · [License](#license) ## 📜 Summary @@ -45,5 +47,7 @@ Reach us through [GitHub issues](https://github.com/corunet/openapi-nodejs-cli/i ## License + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at [https://mozilla.org/MPL/2.0/](https://mozilla.org/MPL/2.0/). - \ No newline at end of file +[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://github.com/corunet/openapi-nodejs-cli/blob/main/LICENSE) From e6b81bea5e59f36029dbe31e2a98ebacb973677e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar=20Abalde=20Reyes?= Date: Tue, 14 Jun 2022 12:42:39 +0200 Subject: [PATCH 2/2] #6 Updates README.md & CONTROBUTION.md --- CONTRIBUTING.md | 46 ++++++++++++++++++++++++++++++++++++++++ README.md | 56 ++++++++++++++++++++++++++++++------------------- 2 files changed, 81 insertions(+), 21 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..502d3b6 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,46 @@ +[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://github.com/corunet/openapi-nodejs-cli/blob/main/LICENSE) + +# OpenAPI NodeJS CLI + +This generator requires the Node version >=17.7.1 to run properly + +## Install dependencies + +To install dependencies run: +`npm i` + +## Build + +Build the project with `npm run build` + +## Usage + +To view usage of the cli run: + +`npm start -- -h` + +### Options + +- `-i `: list of URLs and/or directories to the list of OpenAPI specification used to generate the code +- `--allowed-paths `: list of paths allowed to be used to generate the code +- `--client`: generate client code only +- `--server`: generate server code only + +If `--client` and `--server` are not set, both client and server code will be generated. + +## 🧰 Support + +We’ll be glad to talk and discuss how `openapi-nodejs-cli` can help you 😊 + +Reach us through [GitHub issues](https://github.com/corunet/openapi-nodejs-cli/issues), [email](mailto:info@corunet.com) or [Twitter](https://twitter.com/corunet). + + +### Examples + +- Generate code from 2 OpenAPI specification files (URLs) + + `npm start -- -i http://127.0.0.1:8080/kafka.yaml http://127.0.0.1:8080/schemaRegistry.yaml` + +- Only generate client code from 1 file form a directory using only the given path + + `npm start -- -i /Users/user/specification/kafka.yaml --allowed-paths /kafka --client` diff --git a/README.md b/README.md index 65a3e8b..179a16d 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,53 @@ [![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://github.com/corunet/openapi-nodejs-cli/blob/main/LICENSE) -# OpenAPI NodeJS CLI +[Summary](#summary) · [Getting started](#getting-started) · [Support](#support) · [License](#license) -This generator requires the Node version >=17.7.1 to run properly +## 📜 Summary +`openapi-nodejs-cli` is a typescript code generator from an OpenApi document. -## Install dependencies +`openapi-nodejs-cli` can generate nodejs, typescript client and Angular client methods from an OpenApi document. -To install dependencies run: -`npm i` -## Build +## 🚀 Getting Started -Build the project with `npm run build` +### How to install -## Usage +```bash +npm i @corunet/openapi-nodejs-cli --global +``` -To view usage of the cli run: +### 🧑🏻‍💻 Usage -`npm start -- -h` +```bash +openapi-nodejs-cli input/schema.yaml +``` -### Options +You can retrieve an option list with this command: +``` +openapi-nodejs-cli --help +``` -- `-i `: list of URLs and/or directories to the list of OpenAPI specification used to generate the code -- `--allowed-paths `: list of paths allowed to be used to generate the code -- `--client`: generate client code only -- `--server`: generate server code only +``` +Usage: openapi-nodejs-cli [options] -If `--client` and `--server` are not set, both client and server code will be generated. +Options: + -V, --version output the version number + -i, --input OpenAPI spec URLs or directories + -o, --output Output folder + --client only generate client code + --server only generate server code + --angular generate client code for Angular + -h, --help display help for command +``` +## 🧰 Support -### Examples +We’ll be glad to talk and discuss how `openapi-nodejs-cli` can help you 😊 -- Generate code from 2 OpenAPI specification files (URLs) +Reach us through [GitHub issues](https://github.com/corunet/openapi-nodejs-cli/issues), [email](mailto:info@corunet.com) or [Twitter](https://twitter.com/corunet). - `npm start -- -i http://127.0.0.1:8080/kafka.yaml http://127.0.0.1:8080/schemaRegistry.yaml` +## License -- Only generate client code from 1 file form a directory using only the given path - `npm start -- -i /Users/user/specification/kafka.yaml --allowed-paths /kafka --client` + +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at [https://mozilla.org/MPL/2.0/](https://mozilla.org/MPL/2.0/). +[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://github.com/corunet/openapi-nodejs-cli/blob/main/LICENSE)