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]
-o, --output Write the Postman collection to an output file [string]
-n, --runNewman Run newman on newly created collection [boolean]
-d, --newmanIterationData Iteration data to run newman with newly created collection [string]
--syncPostman Upload generated collection to postman (default: false) [boolean]
-p, --postmanUid Collection UID to upload&overwrite with generated collection [string]
-t, --includeTests Inject test suite (default: true) [boolean]
-c, --portmanConfigFile Path to portman-config.json [string]
-s, --postmanConfigFile Path to postman-config.json [string]
-g, --testSuiteConfigFile Path to postman-testsuite.json [string]
--cliConfigFile Path to the file with the Portman CLI options [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}}"
}
}
yarn portman -u https://specs.apideck.com/crm.yml
yarn portman -u https://specs.apideck.com/crm.yml -b http://localhost:3050 -n true
yarn portman -u https://specs.apideck.com/crm.yml -b http://localhost:3050 -n true -d ./tmp/newman/data/crm.json
yarn portman -l ./tmp/specs/crm.yml -o ./tmp/specs/crm.postman.json
yarn portman -l ./tmp/specs/crm.yml -t false
yarn portman -l ./tmp/specs/crm.yml --syncPostman true
Upload newly generated collection to Postman using the collection ID to overwrite the existing.
yarn portman -l ./tmp/specs/crm.yml --syncPostman true -p 9601963a-53ff-4aaa-92a0-2e70a8a2a748
yarn portman -u https://specs.apideck.com/crm.yml -c ./tmp/crm/portman-config.json -g ./tmp/crm/postman-testsuite.json -s ./common/postman-config.json
All the CLI options can be managed in a separate configuration file and passed along to the portman command. This will make configuration easier, especially in CI/CD implementations.
yarn portman --cliOptionsFile ./examples/cli-options/portman-cli-options.json
All the available Portman CLI options can be used in the config file. By passing the CLI options as parameter, you can overwrite the defined CLI options defined in the file.
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.7 - (2021-05-25)
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.