git-friendly-postman
v1.3.1
Published
Git Friendly Postman Tool
Maintainers
Readme
git-friendly-postman
Why do I need this s**t?
Postman collections are stored in JSON format, which can be lengthy and complex. This makes it challenging to manage changes in Git repositories, as large JSON files are harder to track and review. Additionally, updating the file without using the Postman UI can be cumbersome and prone to errors.
Install
npm install -g git-friendly-postmanTest
git-friendly-postman --helpExample
now you are able to organize your collection in YAML using !!import/single like this:
info:
_postman_id: 97d729c1-ac26-46b9-ad21-1cc452fb6f10
name: EchoNekoApi
schema: https://schema.getpostman.com/json/collection/v2.1.0/collection.json
_exporter_id: '157309'
item:
- name: Users
item:
- !!import/single users/create-user.request.yaml
- !!import/single users/get-all-users.request.yaml
- name: Pets
item:
- !!import/single pets/get-all-pets.request.yaml
- !!import/single test.request.yamlWith the following folders:
- Sample: ./sample/collection
petsget-all-pets.request.yaml
userscreate-user.request.yamlget-all-users.request.yaml
test.request.yamlpostman.yaml
And use the following command to run the collection into your CI/CD:
git-friendly-postman --verbose ./sample/collection/postman.yaml
newman run ./sample/collection/postman.json
git-friendly-postman --verbose --cleanRun Postman Collection
It allows you create temporarily a JSON file to execute postman or newman
git-friendly-postman ./collection.yaml && newman run ./collection.json && git-friendly-postman --cleanExample with logs
# Creates temp collection.json same name same path
git-friendly-postman --verbose \
./sample/git-friendly-collection/EchoNekoApi.postman_collection.yaml
# Run postman collection with newman
newman run ./sample/git-friendly-collection/EchoNekoApi.postman_collection.json
# Removes json and cache files
git-friendly-postman --verbose --cleanExport
It allows you convert your Postman collection into YAML file
git-friendly-postman --verbose \
--export ./sample/export/EchoNekoApi.postman_collection.json \
--output-file ./sample/export/EchoNekoApi.postman_collection.yamlPowered By
- Gary Ascuy from Nekoverse / Organization
References
- Special thanks to yaml-import - rafamel
