2.0.8 ā€¢ Published 3 months ago

openapi2postman v2.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

šŸ› ļø Openapi2Postman Release OpenApi Postman NPM License: LGPL v3

Openapi2Postman creates automatic tests from Openapi 3.0 using postman format. Also, it creates environments files, depending of configuration. Those collections can be importend in postan application. The tests includes tests for 2xx, 4xx... and tests to validate output formats.

This repository is intended for :octocat: community use, it can be modified and adapted without commercial use. If you need a version, support or help for your enterprise or project, please contact us šŸ“§ devrel@apiaddicts.org

Twitter Discord LinkedIn Facebook YouTube

šŸ™Œ Join the Openapi2postman Adopters list

šŸ“¢ If Openapi2postman is part of your organization's toolkit, we kindly encourage you to include your company's name in our Adopters list. šŸ™ This not only significantly boosts the project's visibility and reputation but also represents a small yet impactful way to give back to the project.

OrganizationDescription of Use / Referenc
CloudAppiApification and generation of microservices
Madrid DigitalGeneration of microservices

šŸ‘©šŸ½ā€šŸ’» Contribute to ApiAddicts

We're an inclusive and open community, welcoming you to join our effort to enhance ApiAddicts, and we're excited to prioritize tasks based on community input, inviting you to review and collaborate through our GitHub issue tracker.

Feel free to drop by and greet us on our GitHub discussion or Discord chat. You can also show your support by giving us some GitHub stars ā­ļø, or by following us on Twitter, LinkedIn, and subscribing to our YouTube channel! šŸš€

"Buy Me A Coffee"

šŸ“‘ Getting started

NPM

Install package

npm i openapi2postman -g

First steps

Arguments

argvadescription
--file-fpath openapi file
--configuration-cpath config file

Normal usage

o2p -c .\example\o2p_config_file.json -f .\example\petstore.yaml

Default config

o2p  -f .\example\petstore.yaml

If you do not use the -c argument, the following default configuration will be used. The output path target_folder is ./out.

  api_name: filename,
  is_inline: false,
  schema_is_inline: false,
  schema_pretty_print: true,
  environments:[
    {
      name : "DEV",
      postman_collection_name: "%api_name%_DEV",
      postman_environment_name: "%api_name%_DEV",
      target_folder: "./out",
      has_scopes: false,
      application_token: false,
      number_of_scopes: 0
    }
  ]

Table of content

Structure and submodules

  • docs - This module contents the guides to configurate and run the product. Documents Pdfs by CloudAppi.
  • example - Integration and system tests for SoapUI.
  • src ā€“ Source code
  • test - Testing folder

Build and run

Prerequisites

You need node v10 or later.

run

Please review the o2p_config_file.json before to execute the command Execute node index.js --configuration o2p_config_file.json --file example/swagger_provincias.yml

The output files are the following (in example folder):

  • SWAGGER_API_TestSuite_DEV.postman_collection.json
  • SWAGGER_API_TestSuiteEnv_DEV.postman_environment.json
  • SWAGGER_API_TestSuite_PROD.postman_collection.json
  • SWAGGER_API_TestSuiteEnv_PROD.postman_environment.json

In postman:

  • import generated postman collection file in postman
  • import generated postman environment file in postman
  • update variables in the envirnoment to test all cases

Configuration file

Collections and environments to generate can be configured using a JSON configuration file. Collection and environment name can be specified, as well as the target folder for resulting files, the authorizations collection to be used and some other characteristics. This configuration file has an specification and examples that can be read on the following document:
Configuration file openapi2postman. This document is only available in spanish by now. it will be soon translated to english.

an example configuration file is included in file structure.

Workspace configuration

Node.js and npm package manager are required to run the tool. Its adviced to use preconfigured installation tools provided by the manufacturer: https://nodejs.org/es/download/

šŸ’› Sponsors

2.0.8

3 months ago

2.0.7

4 months ago

2.0.6

4 months ago

2.0.5

4 months ago

2.0.3

7 months ago

2.0.4

7 months ago

2.0.2

8 months ago

2.0.1

8 months ago

2.0.0

8 months ago

1.0.0

8 months ago