From c5d78e285ffe630182abdbce7336e76550064c4d Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 00:35:25 +0530 Subject: [PATCH 01/14] Update README.md --- README.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 5a6542c..e4fb344 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # OpenAPI URL Resolver -`openapi-url-resolver` is a **lightweight** NPM package that provides a simple and efficient way to resolve server URLs from OpenAPI specifications. It also removes protocols from the resolved URLs and allows you to **easily extract host information from OpenAPI definitions**. This package is ideal for developers working with APIs that conform to the [OpenAPI specification](https://swagger.io/specification/) and need to extract server information to make API calls. +**openapi-url-resolver** is a **lightweight** NPM package that provides a simple and efficient way to resolve server URLs from OpenAPI specifications. It also removes protocols from the resolved URLs and allows you to **easily extract host information from OpenAPI definitions**. This package is ideal for developers working with APIs that conform to the [OpenAPI 3.x specification](https://swagger.io/specification/) and need to extract server information to make API calls. ## 📦 Installation @@ -14,12 +14,11 @@ npm install openapi-url-resolver ## 💻 Usage -To use `openapi-url-resolver`, you need to pass an OpenAPI 3.x specification object to the resolve() function. This function will return an array of resolved server URLs: +To use `openapi-url-resolver`, you need to pass an [OpenAPI 3.x specification](https://swagger.io/specification/) object to the `resolve()` function. This function will return an array of resolved server URLs: ```javascript -const openapiUrlResolver = require('./src') +const openapiUrlResolver = require('openapi-url-resolver') -// add complete spec const spec = { openapi: '3.0.0', servers: [ @@ -97,15 +96,10 @@ Contributions to `openapi-url-resolver` are most welcome! If you find a bug or w ## ❤️ Support -If you find this package useful, please consider: - -- Following me on Twitter for updates and package releases. -- Starring this repository on GitHub to show your appreciation. -- Sponsoring me on GitHub to support ongoing development. -- Buying me a coffee via PayPal or Ko-fi to help me stay fueled and focused. +If you find this package useful, please consider [starring this repository]() on GitHub to show your appreciation. You can stay connected with me on Twitter—[@vinit_shahdeo](https://twitter.com/Vinit_Shahdeo). Thank you for your support! ## 📝 License -`openapi-url-resolver` is released under the MIT License. +[openapi-url-resolver](https://github.com/vinitshahdeo/openapi-url-resolver) is released under the [MIT License](./LICENSE). From 5707cf361bcf10bb65298ac4c9160c49634867fa Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 00:42:49 +0530 Subject: [PATCH 02/14] Added BMAC badge --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e4fb344..04825d3 100644 --- a/README.md +++ b/README.md @@ -94,12 +94,14 @@ The below are the known limitations, and they are not handled to keep it a light Contributions to `openapi-url-resolver` are most welcome! If you find a bug or want to suggest a new feature, please open an issue on the GitHub repository. If you want to contribute code, please fork the repository, make your changes, and submit a pull request. Your contributions and feedback are most welcome! +## 📝 License + +[openapi-url-resolver](https://github.com/vinitshahdeo/openapi-url-resolver) is released under the [MIT License](./LICENSE). + ## ❤️ Support If you find this package useful, please consider [starring this repository]() on GitHub to show your appreciation. You can stay connected with me on Twitter—[@vinit_shahdeo](https://twitter.com/Vinit_Shahdeo). Thank you for your support! -## 📝 License - -[openapi-url-resolver](https://github.com/vinitshahdeo/openapi-url-resolver) is released under the [MIT License](./LICENSE). +Buy Me A Coffee From 0e895b6a510166e27d8afb5166e6172b440b56a5 Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 00:44:09 +0530 Subject: [PATCH 03/14] Added emojis --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 04825d3..87e4ce7 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ console.log(serverUrls) ``` -## Testing +## 🧪 Testing You can test using the below command or write your own tests using the OpenAPI specifications [examples](./definitions/). @@ -81,7 +81,7 @@ You can test using the below command or write your own tests using the OpenAPI s npm test ``` -## Limitations +## 🚫 Limitations The below are the known limitations, and they are not handled to keep it a lightweight and focused module to just extract the server information. From 86291ed0570c9d638095dbf96bdbff37031b59d8 Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 00:46:52 +0530 Subject: [PATCH 04/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 87e4ce7..e0a67bf 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # OpenAPI URL Resolver -**openapi-url-resolver** is a **lightweight** NPM package that provides a simple and efficient way to resolve server URLs from OpenAPI specifications. It also removes protocols from the resolved URLs and allows you to **easily extract host information from OpenAPI definitions**. This package is ideal for developers working with APIs that conform to the [OpenAPI 3.x specification](https://swagger.io/specification/) and need to extract server information to make API calls. +**openapi-url-resolver** is a **lightweight** NPM package that provides a simple and efficient way to resolve server URLs from OpenAPI specifications. It also removes protocols from the resolved URLs and allows you to **easily extract host information from OpenAPI definitions**. This package is ideal for developers working with APIs that conform to the [OpenAPI 3.x specification](https://swagger.io/specification/) and need to extract [server information](https://spec.openapis.org/oas/v3.1.0#server-object) to make API calls. ## 📦 Installation From f2a2455a8f31056e8cfb337bf71b6dd2dd724175 Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 00:53:33 +0530 Subject: [PATCH 05/14] Added helper links in the limitations section --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e0a67bf..98e6370 100644 --- a/README.md +++ b/README.md @@ -83,12 +83,12 @@ npm test ## 🚫 Limitations -The below are the known limitations, and they are not handled to keep it a lightweight and focused module to just extract the server information. +The below are the known limitations, and they are not handled to keep it a lightweight and focused module to just extract the [server information](https://spec.openapis.org/oas/v3.1.0#server-object). -- It does not validate the OpenAPI definition. You can use for validating the OpenAPI definition. -- It only works with OpenAPI specification object(JSON format). - - Use js-yml to convert yml to json - - Use postman-converter for Postman collection to OpenAPI json +- It does not validate the OpenAPI definition. You can use [openapi-schema-validator](https://www.npmjs.com/package/openapi-schema-validator) for validating the OpenAPI definition. +- It only works with JSON format. + - Use [yaml-to-json-schema](https://www.npmjs.com/package/yaml-to-json-schema) to convert YAML to JSON. + - Use [postman-to-openapi](https://www.npmjs.com/package/postman-to-openapi) to Postman collection to OpenAPI 3.x ## 🤝 Contributing From 44de1db91c39191017838e9f42741dd3f0aae4c0 Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 00:55:45 +0530 Subject: [PATCH 06/14] Create node.js.yml --- .github/workflows/node.js.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..d28a6cd --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,23 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - run: npm test From a4f232a87f7d54ae21646fa1bd3108d076200269 Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 00:57:50 +0530 Subject: [PATCH 07/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98e6370..b0c1c25 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ The below are the known limitations, and they are not handled to keep it a light ## 🤝 Contributing -Contributions to `openapi-url-resolver` are most welcome! If you find a bug or want to suggest a new feature, please open an issue on the GitHub repository. If you want to contribute code, please fork the repository, make your changes, and submit a pull request. Your contributions and feedback are most welcome! +Contributions to `openapi-url-resolver` are most welcome! If you find a bug or want to suggest a new feature, [please open an issue](https://github.com/vinitshahdeo/openapi-url-resolver/issues/new) on the GitHub repository. If you want to contribute code, [please fork the repository](https://github.com/vinitshahdeo/openapi-url-resolver/fork), make your changes, and **submit a pull request**. Your contributions and feedback are most welcome! ## 📝 License From 0adc6f3b54a6ac8e9706b66672eab47ee9792493 Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 01:00:06 +0530 Subject: [PATCH 08/14] Update node.js.yml --- .github/workflows/node.js.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d28a6cd..14158ed 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,13 +1,10 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - name: Node.js CI on: push: - branches: [ "main" ] + branches: [ main ] pull_request: - branches: [ "main" ] + branches: [ main ] jobs: build: @@ -16,8 +13,14 @@ jobs: strategy: matrix: - node-version: [14.x, 16.x, 18.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + node-version: [10.x, 12.x, 14.x, 15.x] steps: - - run: npm test + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build --if-present + - run: npm test From 724e6049fd7effdd2f471525ca414461fb0a3e63 Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 01:01:00 +0530 Subject: [PATCH 09/14] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 14158ed..57987fc 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x, 15.x] + node-version: [12.x, 14.x, 15.x] steps: - uses: actions/checkout@v3 From f97ece6fbc7adf05d84396a53a3c1cc1d0d3f537 Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 01:03:12 +0530 Subject: [PATCH 10/14] Create FUNDING.yml --- .github/FUNDING.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..265a9fc --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +# These are supported funding model platforms + +github: vinitshahdeo +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: vinitshahdeo +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From 37812a449ca970111d2d92745ab98732efc546ca Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 01:04:45 +0530 Subject: [PATCH 11/14] Update .npmignore --- .npmignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.npmignore b/.npmignore index 84c2f26..1c897aa 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,3 @@ test/ -definitions/ \ No newline at end of file +definitions/ +.github/ From a9d25ce113b226d3aa6bc7bd35b0381bcd6539d9 Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 01:06:05 +0530 Subject: [PATCH 12/14] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b0c1c25..93b9c2b 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,9 @@ The below are the known limitations, and they are not handled to keep it a light ## 🤝 Contributing -Contributions to `openapi-url-resolver` are most welcome! If you find a bug or want to suggest a new feature, [please open an issue](https://github.com/vinitshahdeo/openapi-url-resolver/issues/new) on the GitHub repository. If you want to contribute code, [please fork the repository](https://github.com/vinitshahdeo/openapi-url-resolver/fork), make your changes, and **submit a pull request**. Your contributions and feedback are most welcome! +**Contributions to `openapi-url-resolver` are most welcome!** + +If you find a bug or want to suggest a new feature, [please open an issue](https://github.com/vinitshahdeo/openapi-url-resolver/issues/new) on the GitHub repository. If you want to contribute code, [please fork the repository](https://github.com/vinitshahdeo/openapi-url-resolver/fork), make your changes, and **submit a pull request**. Your contributions and feedback are most welcome! ## 📝 License @@ -100,8 +102,8 @@ Contributions to `openapi-url-resolver` are most welcome! If you find a bug or w ## ❤️ Support -If you find this package useful, please consider [starring this repository]() on GitHub to show your appreciation. You can stay connected with me on Twitter—[@vinit_shahdeo](https://twitter.com/Vinit_Shahdeo). - -Thank you for your support! +If you find this package useful, please consider [starring this repository]() on GitHub to show your appreciation. You can stay connected with me on Twitter—[@vinit_shahdeo](https://twitter.com/Vinit_Shahdeo). Buy Me A Coffee + +Thank you for your support! 🙏 From fb13a810393ca5f74280fac235d83c66504023ce Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 01:09:22 +0530 Subject: [PATCH 13/14] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 93b9c2b..868b07e 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ # OpenAPI URL Resolver +![](https://github.com/vinitshahdeo/openapi-url-resolver/actions/workflows/node.js.yml/badge.svg) + + **openapi-url-resolver** is a **lightweight** NPM package that provides a simple and efficient way to resolve server URLs from OpenAPI specifications. It also removes protocols from the resolved URLs and allows you to **easily extract host information from OpenAPI definitions**. This package is ideal for developers working with APIs that conform to the [OpenAPI 3.x specification](https://swagger.io/specification/) and need to extract [server information](https://spec.openapis.org/oas/v3.1.0#server-object) to make API calls. ## 📦 Installation From 510ab726edce5a973e147b00e02ea2c3f18aba16 Mon Sep 17 00:00:00 2001 From: Vinit Shahdeo Date: Fri, 21 Apr 2023 01:12:04 +0530 Subject: [PATCH 14/14] Added workflow link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 868b07e..348e7bd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # OpenAPI URL Resolver -![](https://github.com/vinitshahdeo/openapi-url-resolver/actions/workflows/node.js.yml/badge.svg) +![https://github.com/vinitshahdeo/openapi-url-resolver/actions/workflows/node.js.yml](https://github.com/vinitshahdeo/openapi-url-resolver/actions/workflows/node.js.yml/badge.svg) **openapi-url-resolver** is a **lightweight** NPM package that provides a simple and efficient way to resolve server URLs from OpenAPI specifications. It also removes protocols from the resolved URLs and allows you to **easily extract host information from OpenAPI definitions**. This package is ideal for developers working with APIs that conform to the [OpenAPI 3.x specification](https://swagger.io/specification/) and need to extract [server information](https://spec.openapis.org/oas/v3.1.0#server-object) to make API calls.