Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
[![Join the chat at https://gitter.im/josephpconley/swagger2postman](https://badges.gitter.im/josephpconley/swagger2postman.svg)](https://gitter.im/josephpconley/swagger2postman?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Create a Postman collection from Swagger documentation

##Motivation
## Motivation

[Swagger UI](https://github.com/swagger-api/swagger-ui) provides a nice way to interact with an API documented by the [Swagger specification](https://github.com/swagger-api/swagger-spec).
But if you're working with an identical API across multiple environments, or you want to test edge cases that Swagger UI doesn't support
(like omitting a required query parameter), Swagger UI comes up a bit short.

[Postman](https://www.getpostman.com/) to the rescue! Using Postman you can define variables for multiple environments and have more control over request generation.

##Purpose
## Purpose
This library takes Swagger documentation served in JSON and converts it into a JSON collection which can be imported directly into Postman.
You can see a full description of the Swagger JSON spec at [http://swagger.io/specification/](http://swagger.io/specification/)

##Command line
## Command line

To convert a Swagger 2.0 JSON file to a valid Postman collection:

Expand All @@ -26,7 +26,7 @@ To convert a Swagger 1.2 hosted endpoint to a valid Postman collection:
sbt "runMain com.josephpconley.swagger2postman.app.v12.Swagger2PostmanApp <host> <collectionName> [<headerKey=headerValue> ... ]"


##Demo
## Demo

Try out an online version at [http://app.josephpconley.com/swagger2postman](http://app.josephpconley.com/swagger2postman)

Expand All @@ -35,7 +35,7 @@ Or using `curl` to convert a Swagger 2.0 document into a Postman JSON import fil
curl -X POST --data "@v2petstore-swagger.json" "http://app.josephpconley.com/swagger20?name=my_collection&header_key=header_value" --header "Content-Type:application/json" > my_collection.json


##Multiple environments
## Multiple environments

To take advantage of multi-environment testing, I would first run swagger2postman against a hosted Swagger doc.
Then I do a simple Find/Replace, replacing the target host with a handlebars variable like `{{host}}`.
Expand All @@ -45,9 +45,9 @@ Toggling these environments with your imported collection will let you seamlessl
You can also use environment variables for authentication. If your API uses a header for authentication, then pass a `headerKey`=`{{headerValue}}`
so that all endpoints get a global authentication header with an environment-dependent value.

##Release Notes
## Release Notes
### 1.1
- Initial support for Swagger 2.0

### 1.0
- Initial support for Swagger 1.2
- Initial support for Swagger 1.2