Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@apideck/portman
Advanced tools
Port OpenAPI Spec to Postman Collection!
Portman sits on top of @thim81's open PR. Tim has made awesome progress in converting an OAS to a Postman Collection with automated test injection. At Apideck, we wanted to include this as part of an automated process that could be injecting directly into our CI/CD pipeline.
With Portman, we can:
.env.example
to .env
and add environment variables you need available to your collection.Usage: -u <url> -l <local> -b <baseUrl> -t <includeTests>
Options:
--help Show help [boolean]
--version Show version number [boolean]
-u, --url URL of OAS to port to postman collection [string]
-l, --local Use local OAS to port to postman collection [string]
-b, --baseUrl Override spec baseUrl to use in test suite [string]
-n, --runNewman Run newman on newly created collection [boolean]
-d, --newmanIterationData Iteration data to run newman with newly created collection [string]
-p, --postmanUid Collection ID to upload generated collection to postman [string]
-t, --includeTests Inject test suite (default: true) [boolean]
-c, --configFile Path to portman-config.json [string]
Portman uses dotenv
to not only access variables for functionality, but you can easily add environment variables that you'd like declared within your postman environment.
Simply prefix any variabled name with PORTMAN_
, and it will be availble for use in your postman collection as the camelcased equivalent. For example:
PORTMAN_CONSUMER_ID=test_user_id
will be available in your collection or tests by referencing:
{{consumerId}}
To generate the collection with tests, define a JSON file like the example (portman-config.json) below and run the CLI with the --generate option.
{
"preRequestScripts": [
"pm.collectionVariables.set('statusId', '12345')"
],
"variableOverwrites": {
"x-apideck-app-id": "{{applicationId}}"
}
}
Pass in the remote hosted spec:
yarn portman -u https://specs.apideck.com/crm.yml -c portman-config.json
Overwrite the baseUrl in spec and run newman.
yarn portman -u https://specs.apideck.com/crm.yml -b http://localhost:3050 -n true -c portman-config.json
Path pass to local data file for newman to use for iterations.
yarn portman -u https://specs.apideck.com/crm.yml -b http://localhost:3050 -n true -d ./tmp/newman/data/crm.json
Pass path to a local spec (useful when updating your specs)
yarn portman -l ./tmp/specs/crm.yml -c portman-config.json
Skip tests and just generate collection.
yarn portman -l ./tmp/specs/crm.yml -t false -c portman-config.json
Upload newly generated collection to Postman using the collection ID.
yarn portman -l ./tmp/specs/crm.yml -p 9601963a-53ff-4aaa-92a0-2e70a8a2a748 -c portman-config.json
Your generated Postman Collection is written to ./tmp/converted/${specName}.json
if you are manually importing to Postman or need to inspect for debugging.
v0.0.2 - (2021-05-06)
FAQs
Port OpenAPI Spec to Postman Collection, with contract & variation tests included
The npm package @apideck/portman receives a total of 7,900 weekly downloads. As such, @apideck/portman popularity was classified as popular.
We found that @apideck/portman demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.