https://github.com/bpedro/postman-openapi-sync
Postman OpenAPI sync makes sure that your local OpenAPI spec is in sync with Postman.
https://github.com/bpedro/postman-openapi-sync
api openapi postman sync
Last synced: 10 months ago
JSON representation
Postman OpenAPI sync makes sure that your local OpenAPI spec is in sync with Postman.
- Host: GitHub
- URL: https://github.com/bpedro/postman-openapi-sync
- Owner: bpedro
- License: mit
- Created: 2021-02-18T22:32:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-19T14:33:48.000Z (almost 5 years ago)
- Last Synced: 2025-03-29T00:11:16.762Z (10 months ago)
- Topics: api, openapi, postman, sync
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Postman OpenAPI sync
Postman OpenAPI sync makes sure that your local OpenAPI spec is in sync with Postman. It does that by using your local OpenAPI spec as the source of truth and synchronizing its contents with Postman.
## Installing
To install `postman-openapi-sync` simply clone this repository and then run:
```
npm install -g
```
`postman-openapi-sync` will be installed globally on your system.
## Running
To run `postman-api-sync` you must first create two environment variables:
- `POSTMAN_API_KEY`: your Postman API key.
- `POSTMAN_WORKSPACE_ID`: the ID of the workspace where you want to synchronize your API.
Then, you can simply run:
```
postman-openapi-sync
```
Where `openapi_file` is your local OpenAPI specification file.
## Flow
1. Read a local OpenAPI specification file.
2. Obtain the local API name and version from the specification file.
3. Check if there is an API with the same name on Postman.
4. If not, create an API with the same name and description as the local OpenAPI specification.
5. Create an API version with the same value as the local OpenAPI specification, if one doesn't already exist.
6. Update the API schema with the value from the local OpenAPI specification.