-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle Postman URL query and variable fields
- Loading branch information
Showing
7 changed files
with
356 additions
and
73 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
File renamed without changes.
77 changes: 77 additions & 0 deletions
77
plugins/importer-postman/tests/fixtures/nested.output.json
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,77 @@ | ||
{ | ||
"resources": { | ||
"workspaces": [ | ||
{ | ||
"model": "workspace", | ||
"id": "GENERATE_ID::WORKSPACE_0", | ||
"name": "New Collection", | ||
"description": "", | ||
"variables": [] | ||
} | ||
], | ||
"environments": [], | ||
"httpRequests": [ | ||
{ | ||
"model": "http_request", | ||
"id": "GENERATE_ID::HTTP_REQUEST_0", | ||
"workspaceId": "GENERATE_ID::WORKSPACE_0", | ||
"folderId": "GENERATE_ID::FOLDER_1", | ||
"name": "Request 1", | ||
"method": "GET", | ||
"url": "", | ||
"urlParameters": [], | ||
"body": {}, | ||
"bodyType": null, | ||
"authentication": {}, | ||
"authenticationType": null, | ||
"headers": [] | ||
}, | ||
{ | ||
"model": "http_request", | ||
"id": "GENERATE_ID::HTTP_REQUEST_1", | ||
"workspaceId": "GENERATE_ID::WORKSPACE_0", | ||
"folderId": "GENERATE_ID::FOLDER_0", | ||
"name": "Request 2", | ||
"method": "GET", | ||
"url": "", | ||
"urlParameters": [], | ||
"body": {}, | ||
"bodyType": null, | ||
"authentication": {}, | ||
"authenticationType": null, | ||
"headers": [] | ||
}, | ||
{ | ||
"model": "http_request", | ||
"id": "GENERATE_ID::HTTP_REQUEST_2", | ||
"workspaceId": "GENERATE_ID::WORKSPACE_0", | ||
"folderId": null, | ||
"name": "Request 3", | ||
"method": "GET", | ||
"url": "", | ||
"urlParameters": [], | ||
"body": {}, | ||
"bodyType": null, | ||
"authentication": {}, | ||
"authenticationType": null, | ||
"headers": [] | ||
} | ||
], | ||
"folders": [ | ||
{ | ||
"model": "folder", | ||
"workspaceId": "GENERATE_ID::WORKSPACE_0", | ||
"id": "GENERATE_ID::FOLDER_0", | ||
"name": "Top Folder", | ||
"folderId": null | ||
}, | ||
{ | ||
"model": "folder", | ||
"workspaceId": "GENERATE_ID::WORKSPACE_0", | ||
"id": "GENERATE_ID::FOLDER_1", | ||
"name": "Nested Folder", | ||
"folderId": "GENERATE_ID::FOLDER_0" | ||
} | ||
] | ||
} | ||
} |
136 changes: 136 additions & 0 deletions
136
plugins/importer-postman/tests/fixtures/params.input.json
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,136 @@ | ||
{ | ||
"info": { | ||
"_postman_id": "9e6dfada-256c-49ea-a38f-7d1b05b7ca2d", | ||
"name": "New Collection", | ||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", | ||
"_exporter_id": "18798" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Form URL", | ||
"request": { | ||
"auth": { | ||
"type": "bearer", | ||
"bearer": [ | ||
{ | ||
"key": "token", | ||
"value": "baeare", | ||
"type": "string" | ||
} | ||
] | ||
}, | ||
"method": "POST", | ||
"header": [ | ||
{ | ||
"key": "X-foo", | ||
"value": "bar", | ||
"description": "description" | ||
}, | ||
{ | ||
"key": "Disabled", | ||
"value": "tnroant", | ||
"description": "ntisorantosra", | ||
"disabled": true | ||
} | ||
], | ||
"body": { | ||
"mode": "formdata", | ||
"formdata": [ | ||
{ | ||
"key": "Key", | ||
"contentType": "Custom/COntent", | ||
"description": "DEscription", | ||
"type": "file", | ||
"src": "/Users/gschier/Desktop/Screenshot 2024-05-31 at 12.05.11 PM.png" | ||
} | ||
] | ||
}, | ||
"url": { | ||
"raw": "example.com/:foo/:bar?q=qqq&", | ||
"host": [ | ||
"example", | ||
"com" | ||
], | ||
"path": [ | ||
":foo", | ||
":bar" | ||
], | ||
"query": [ | ||
{ | ||
"key": "disabled", | ||
"value": "secondvalue", | ||
"description": "this is disabled", | ||
"disabled": true | ||
}, | ||
{ | ||
"key": "q", | ||
"value": "qqq", | ||
"description": "hello" | ||
}, | ||
{ | ||
"key": "", | ||
"value": null | ||
} | ||
], | ||
"variable": [ | ||
{ | ||
"key": "foo", | ||
"value": "fff", | ||
"description": "Description" | ||
}, | ||
{ | ||
"key": "bar", | ||
"value": "bbb", | ||
"description": "bbb description" | ||
} | ||
] | ||
} | ||
}, | ||
"response": [] | ||
} | ||
], | ||
"auth": { | ||
"type": "basic", | ||
"basic": [ | ||
{ | ||
"key": "password", | ||
"value": "globalpass", | ||
"type": "string" | ||
}, | ||
{ | ||
"key": "username", | ||
"value": "globaluser", | ||
"type": "string" | ||
} | ||
] | ||
}, | ||
"event": [ | ||
{ | ||
"listen": "prerequest", | ||
"script": { | ||
"type": "text/javascript", | ||
"packages": {}, | ||
"exec": [ | ||
"" | ||
] | ||
} | ||
}, | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"type": "text/javascript", | ||
"packages": {}, | ||
"exec": [ | ||
"" | ||
] | ||
} | ||
} | ||
], | ||
"variable": [ | ||
{ | ||
"key": "COLLECTION VARIABLE", | ||
"value": "collection variable", | ||
"type": "string" | ||
} | ||
] | ||
} |
90 changes: 90 additions & 0 deletions
90
plugins/importer-postman/tests/fixtures/params.output.json
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,90 @@ | ||
{ | ||
"resources": { | ||
"workspaces": [ | ||
{ | ||
"model": "workspace", | ||
"id": "GENERATE_ID::WORKSPACE_1", | ||
"name": "New Collection", | ||
"description": "", | ||
"variables": [ | ||
{ | ||
"name": "COLLECTION VARIABLE", | ||
"value": "collection variable" | ||
} | ||
] | ||
} | ||
], | ||
"environments": [], | ||
"httpRequests": [ | ||
{ | ||
"model": "http_request", | ||
"id": "GENERATE_ID::HTTP_REQUEST_3", | ||
"workspaceId": "GENERATE_ID::WORKSPACE_1", | ||
"folderId": null, | ||
"name": "Form URL", | ||
"method": "POST", | ||
"url": "example.com/:foo/:bar", | ||
"urlParameters": [ | ||
{ | ||
"name": "disabled", | ||
"value": "secondvalue", | ||
"enabled": false | ||
}, | ||
{ | ||
"name": "q", | ||
"value": "qqq", | ||
"enabled": true | ||
}, | ||
{ | ||
"name": "", | ||
"value": "", | ||
"enabled": true | ||
}, | ||
{ | ||
"name": ":foo", | ||
"value": "fff", | ||
"enabled": true | ||
}, | ||
{ | ||
"name": ":bar", | ||
"value": "bbb", | ||
"enabled": true | ||
} | ||
], | ||
"body": { | ||
"form": [ | ||
{ | ||
"enabled": true, | ||
"contentType": "Custom/COntent", | ||
"name": "Key", | ||
"file": "/Users/gschier/Desktop/Screenshot 2024-05-31 at 12.05.11 PM.png" | ||
} | ||
] | ||
}, | ||
"bodyType": "multipart/form-data", | ||
"authentication": { | ||
"token": "" | ||
}, | ||
"authenticationType": "bearer", | ||
"headers": [ | ||
{ | ||
"name": "X-foo", | ||
"value": "bar", | ||
"enabled": true | ||
}, | ||
{ | ||
"name": "Disabled", | ||
"value": "tnroant", | ||
"enabled": false | ||
}, | ||
{ | ||
"name": "Content-Type", | ||
"value": "multipart/form-data", | ||
"enabled": true | ||
} | ||
] | ||
} | ||
], | ||
"folders": [] | ||
} | ||
} |
Oops, something went wrong.