About openapi to postman collection
Convert an OpenAPI or Swagger file into a Postman collection so you can test every endpoint without creating requests by hand.
After importing
- Set a base URL variable for each environment.
- Add authentication to the collection.
- Save example responses for documentation.
A worked example
A specification with 25 endpoints becomes a collection with folders by tag, each request holding the example body and parameters. Set a baseUrl variable to your test server, add a token to the collection authorisation and run the whole collection to smoke test the API.
Tips
- Use environments for local, staging and production.
- Add tests to check the status code and key fields.
- Keep the collection in version control with the API.
Keeping it in sync
Re-import the specification when the API changes and compare the collections, so that tests do not call endpoints that no longer exist.
