0.0.8 • Published 5 years ago

@pwccnhk/o2p v0.0.8

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

O2P - Toolkit for merging OpenAPI to Postman Collection

npm Version

Merge OpenAPI 3.0 to existing Postman Collection 2.1

This project is based on official Postman project openapi-to-postman with ability to merge the converted result to your existing Postman v2.1 collection.

The existing toolkit do the converting well, but if you're advanced user of Postman, you probably found that your pre-flight script, test cases, or even request model, examples get replaced for every convert. You can avoiding it by using


Options

-i / --import: File path to your OpenAPI 3.0 json/yaml

-e / --export: File path to export the converted result

-m / --merge (optional): File path to your existing postman, it will be merged to the converted result

Examples

  • To merge new changes from openapi.json with existing collection my-postman.json to postman.json, type the following command:

    o2p -i openapi.json -m my-postman.json -e postman.json
  • To just convert without merge

    o2p -i openapi.json -e postman.json

The rules

Add, Update, Delete or Replace? Check below table:

(This is better to have a config file or interactive interface to config the behaviour, welcome to contribute!)

Terminology:

  • Information: Project name, version
  • Variables: Environment variables, Global variable...etc. (ref. Postman Document)
  • Events: Pre-flight script, unit test scrips in Postman
  • Item: The actually API request
Item Only On LeftItem On BothItem Only On Right
InformationAddUpdateDelete
VariablesAddNo ActionNo Action
Events-No ActionNo Action
Item
- Url Host & Path-Update-
- Url QueryAddNo ActionDelete
- Method-Update-
- Auth-Update-
- HeadersAddNo ActionDelete
- Body (Both Raw)AddConflictNo Action
- Body (Both Form)AddNo ActionDelete
- Body (Other, Same type)AddNo ActionNo Action
- Body (Other, Diff type)AddUpdateNo Action
- Response (Example)AddUpdateDelete
0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago