-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include query parameters and headers in the generated Postman collect…
…ion. (#537) * Include query parameters in the generated Postman collection. * Style fixes * Also include headers in the Postman collection. * Also include JSON content type headers for good measure. * Update the tests. * Add a test to validate the body parameters in a Postman collection. * Remove the "Content-Type" header again, as we are actually sending content as form data. * Add a query test and make the tests more deterministic. * PR fixes.
- Loading branch information
Showing
7 changed files
with
376 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
{"variables":[],"info":{"name":"Laravel API","_postman_id":"","description":"","schema":"https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json"},"item":[{"name":"Group A","description":"","item":[{"name":"Example title.","request":{"url":"http:\/\/localhost\/api\/test","method":"GET","body":{"mode":"formdata","formdata":[]},"description":"This will be the long description.\nIt can also be multiple lines long.","response":[]}},{"name":"http:\/\/localhost\/api\/responseTag","request":{"url":"http:\/\/localhost\/api\/responseTag","method":"POST","body":{"mode":"formdata","formdata":[]},"description":"","response":[]}}]}]} | ||
{ | ||
"variables": [], | ||
"info": { | ||
"name": "Laravel API", | ||
"_postman_id": "", | ||
"description": "", | ||
"schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Group A", | ||
"description": "", | ||
"item": [ | ||
{ | ||
"name": "Example title.", | ||
"request": { | ||
"url": "http:\/\/localhost\/api\/test", | ||
"method": "GET", | ||
"header": [ | ||
{ | ||
"key": "Accept", | ||
"value": "application/json" | ||
} | ||
], | ||
"body": { | ||
"mode": "formdata", | ||
"formdata": [] | ||
}, | ||
"description": "This will be the long description.\nIt can also be multiple lines long.", | ||
"response": [] | ||
} | ||
}, | ||
{ | ||
"name": "http:\/\/localhost\/api\/responseTag", | ||
"request": { | ||
"url": "http:\/\/localhost\/api\/responseTag", | ||
"method": "POST", | ||
"header": [ | ||
{ | ||
"key": "Accept", | ||
"value": "application/json" | ||
} | ||
], | ||
"body": { | ||
"mode": "formdata", | ||
"formdata": [] | ||
}, | ||
"description": "", | ||
"response": [] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
{"variables":[],"info":{"name":"Laravel API","_postman_id":"","description":"","schema":"https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json"},"item":[{"name":"Group A","description":"","item":[{"name":"Example title.","request":{"url":"http:\/\/yourapp.app\/api\/test","method":"GET","body":{"mode":"formdata","formdata":[]},"description":"This will be the long description.\nIt can also be multiple lines long.","response":[]}},{"name":"http:\/\/yourapp.app\/api\/responseTag","request":{"url":"http:\/\/yourapp.app\/api\/responseTag","method":"POST","body":{"mode":"formdata","formdata":[]},"description":"","response":[]}}]}]} | ||
{ | ||
"variables": [], | ||
"info": { | ||
"name": "Laravel API", | ||
"_postman_id": "", | ||
"description": "", | ||
"schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Group A", | ||
"description": "", | ||
"item": [ | ||
{ | ||
"name": "Example title.", | ||
"request": { | ||
"url": "http:\/\/yourapp.app\/api\/test", | ||
"method": "GET", | ||
"header": [ | ||
{ | ||
"key": "Accept", | ||
"value": "application/json" | ||
} | ||
], | ||
"body": { | ||
"mode": "formdata", | ||
"formdata": [] | ||
}, | ||
"description": "This will be the long description.\nIt can also be multiple lines long.", | ||
"response": [] | ||
} | ||
}, | ||
{ | ||
"name": "http:\/\/yourapp.app\/api\/responseTag", | ||
"request": { | ||
"url": "http:\/\/yourapp.app\/api\/responseTag", | ||
"method": "POST", | ||
"header": [ | ||
{ | ||
"key": "Accept", | ||
"value": "application/json" | ||
} | ||
], | ||
"body": { | ||
"mode": "formdata", | ||
"formdata": [] | ||
}, | ||
"description": "", | ||
"response": [] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
"variables": [], | ||
"info": { | ||
"name": "Laravel API", | ||
"_postman_id": "", | ||
"description": "", | ||
"schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Group A", | ||
"description": "", | ||
"item": [ | ||
{ | ||
"name": "http://localhost/api/withBodyParameters", | ||
"request": { | ||
"url": "http:\/\/localhost\/api\/withBodyParameters", | ||
"method": "GET", | ||
"header": [ | ||
{ | ||
"key": "Accept", | ||
"value": "application/json" | ||
} | ||
], | ||
"body": { | ||
"mode": "formdata", | ||
"formdata": [ | ||
{ | ||
"key": "user_id", | ||
"value": 9, | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "room_id", | ||
"value": "consequatur", | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "forever", | ||
"value": false, | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "another_one", | ||
"value": 11613.31890586, | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "yet_another_param", | ||
"value": [], | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "even_more_param", | ||
"value": [], | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "book.name", | ||
"value": "consequatur", | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "book.author_id", | ||
"value": 17, | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "book[pages_count]", | ||
"value": 17, | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "ids.*", | ||
"value": 17, | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "users.*.first_name", | ||
"value": "John", | ||
"type": "text", | ||
"enabled": true | ||
}, | ||
{ | ||
"key": "users.*.last_name", | ||
"value": "Doe", | ||
"type": "text", | ||
"enabled": true | ||
} | ||
] | ||
}, | ||
"description": "", | ||
"response": [] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"variables": [], | ||
"info": { | ||
"name": "Laravel API", | ||
"_postman_id": "", | ||
"description": "", | ||
"schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Group A", | ||
"description": "", | ||
"item": [ | ||
{ | ||
"name": "http://localhost/api/headers", | ||
"request": { | ||
"url": "http:\/\/localhost\/api\/headers", | ||
"method": "GET", | ||
"header": [ | ||
{ | ||
"key": "Authorization", | ||
"value": "customAuthToken" | ||
}, | ||
{ | ||
"key": "Custom-Header", | ||
"value": "NotSoCustom" | ||
}, | ||
{ | ||
"key": "Accept", | ||
"value": "application/json" | ||
} | ||
], | ||
"body": { | ||
"mode": "formdata", | ||
"formdata": [] | ||
}, | ||
"description": "", | ||
"response": [] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"variables": [], | ||
"info": { | ||
"name": "Laravel API", | ||
"_postman_id": "", | ||
"description": "", | ||
"schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.0.0\/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Group A", | ||
"description": "", | ||
"item": [ | ||
{ | ||
"name": "http://localhost/api/withQueryParameters", | ||
"request": { | ||
"url": "http:\/\/localhost\/api\/withQueryParameters?location_id=consequatur&user_id=me&page=4&filters=consequatur", | ||
"method": "GET", | ||
"header": [ | ||
{ | ||
"key": "Accept", | ||
"value": "application/json" | ||
} | ||
], | ||
"body": { | ||
"mode": "formdata", | ||
"formdata": [] | ||
}, | ||
"description": "", | ||
"response": [] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.