liveBook · Manning

Portman

As explained in Automating API Delivery

Portman is a command-line tool that generates and executes Postman collections for testing API implementations against OpenAPI definitions.

Portman generates and executes Postman collections from an OpenAPI definition, checking whether an implemented API conforms to its published schema. It suits external or public APIs where consumer-driven contract tests are unavailable and can run in CI/CD pipelines. section 7.4.2 section 7.8

A typical Portman workflow is:

  • Define the OpenAPI file, generated collection name, environment variables, and server URL in a CLI options file. section 7.4.2
  • Configure contract tests for operations, such as successful status codes, schema validation, content type, JSON bodies, and required headers. section 7.4.2
  • Generate the collection, optionally include Portman tests, and execute it with Portman’s embedded Newman runner. section 7.4.2
  • Inspect each operation’s result and use failures to identify mismatches between implementation responses and the OpenAPI definition. section 7.4.2

Product Catalog API check

Running Portman against a local Product Catalog API produces a collection report for a GET product-details operation. A passing run records a 2xx status, valid schema, application/json content type, and a JSON response body, followed by “Collection run completed.”

How Automating API Delivery covers it

How deep it goes
Explains CLI and JSON configuration, generated collections, Newman execution, and response assertions without detailing Portman internals.
Examples
Demonstrates a Product Catalog GET operation with status, schema, content-type, and JSON-body assertions.
What it assumes
Assumes an OpenAPI definition, an API server, and installed tooling while teaching the generated schema-testing workflow.
What you can do after
Operate Portman through CLI and JSON files to generate, execute, and interpret OpenAPI-based API conformance tests.
How it connects
Connects OpenAPI, schema testing, contract testing, Postman collections, Newman, and CI/CD.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Automating API Delivery. The section links point to the parts of the book it draws on.