diff --git a/CHANGELOG.md b/CHANGELOG.md index e422c1ac0..3a88ad41f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## [Unreleased] +## [v1.10.0] - 2024-05-02 + +### Fixed + +- Fix `+` char being encoded in query params of multiple languages. +- Fix special characters not being escaped in multiple languages. + ## [v1.9.0] - 2024-01-18 ### Fixed @@ -146,7 +153,9 @@ v1.0.0 (May 29, 2020) - Add ES6 syntax support for NodeJS Request, NodeJS Native and NodeJS Unirest - Fix snippet generation for powershell and jquery, where form data params had no type field -[Unreleased]: https://github.com/postmanlabs/postman-code-generators/compare/v1.9.0...HEAD +[Unreleased]: https://github.com/postmanlabs/postman-code-generators/compare/v1.10.0...HEAD + +[v1.10.0]: https://github.com/postmanlabs/postman-code-generators/compare/v1.9.0...v1.10.0 [v1.9.0]: https://github.com/postmanlabs/postman-code-generators/compare/v1.8.0...v1.9.0 diff --git a/codegens/csharp-httpclient/test/unit/fixtures/testcollection/collection.json b/codegens/csharp-httpclient/test/unit/fixtures/testcollection/collection.json index 517b4557b..89c069bd4 100644 --- a/codegens/csharp-httpclient/test/unit/fixtures/testcollection/collection.json +++ b/codegens/csharp-httpclient/test/unit/fixtures/testcollection/collection.json @@ -648,11 +648,11 @@ ], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" diff --git a/codegens/csharp-restsharp/test/unit/fixtures/testcollection/collection.json b/codegens/csharp-restsharp/test/unit/fixtures/testcollection/collection.json index ed7f40ab5..0a945dc9e 100644 --- a/codegens/csharp-restsharp/test/unit/fixtures/testcollection/collection.json +++ b/codegens/csharp-restsharp/test/unit/fixtures/testcollection/collection.json @@ -1098,13 +1098,11 @@ "raw": "" }, "url": { - "raw": "https://704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1.mock.pstmn.io/link", + "raw": "https://postman-echo.com/link", "protocol": "https", "host": [ - "704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path": [ "link" @@ -1128,13 +1126,11 @@ "raw": "" }, "url": { - "raw": "https://704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1.mock.pstmn.io/unlick", + "raw": "https://postman-echo.com/unlick", "protocol": "https", "host": [ - "704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path": [ "unlick" @@ -1158,13 +1154,11 @@ "raw": "" }, "url": { - "raw": "https://704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1.mock.pstmn.io/lock", + "raw": "https://postman-echo.com/lock", "protocol": "https", "host": [ - "704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path": [ "lock" @@ -1180,13 +1174,11 @@ "header": [], "body": {}, "url": { - "raw": "https://704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1.mock.pstmn.io/unlock", + "raw": "https://postman-echo.com/unlock", "protocol": "https", "host": [ - "704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path": [ "unlock" @@ -1210,13 +1202,11 @@ "raw": "" }, "url": { - "raw": "https://704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1.mock.pstmn.io/profind", + "raw": "https://postman-echo.com/profind", "protocol": "https", "host": [ - "704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path": [ "profind" @@ -1240,13 +1230,11 @@ "raw": "" }, "url": { - "raw": "https://704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1.mock.pstmn.io/view", + "raw": "https://postman-echo.com/view", "protocol": "https", "host": [ - "704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path": [ "view" @@ -1262,13 +1250,11 @@ "header": [], "body": {}, "url": { - "raw": "https://704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1.mock.pstmn.io/view", + "raw": "https://postman-echo.com/view", "protocol": "https", "host": [ - "704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path": [ "view" @@ -1284,13 +1270,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1378,7 +1362,7 @@ } ], "cookie": [], - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] }, @@ -1389,13 +1373,11 @@ "header": [], "body": {}, "url": { - "raw": "https://704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1.mock.pstmn.io/copy", + "raw": "https://postman-echo.com/copy", "protocol": "https", "host": [ - "704c30e8-77fe-4dc4-93e2-9c9c68dfb4e1", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path": [ "copy" @@ -1411,11 +1393,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1527,14 +1509,14 @@ { "expires": "Thu Mar 14 2019 13:12:10 GMT+0530 (IST)", "httpOnly": true, - "domain": "mockbin.org", + "domain": "postman-echo.com", "path": "/", "secure": false, "value": "dfb94a3e1f3f8a9956138e4896847caf21521013330", "key": "__cfduid" } ], - "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://mockbin.org/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"mockbin.org\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" + "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://postman-echo.com/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" } ] } diff --git a/codegens/curl/lib/util.js b/codegens/curl/lib/util.js index 9c7229f68..c10640085 100644 --- a/codegens/curl/lib/util.js +++ b/codegens/curl/lib/util.js @@ -29,6 +29,13 @@ var self = module.exports = { inputString = inputString.replace(/"/g, '\\"'); // Escape backslash if double quote was already escaped before call to sanitize inputString = inputString.replace(/(?\n Test Test\n" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -699,11 +699,11 @@ "raw": "\n Test Test\n" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -728,14 +728,13 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request/:action", + "raw": "https://postman-echo.com/:action", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ - "request", ":action" ], "variable": [ @@ -788,11 +787,11 @@ "raw": "Etiam mi lacus, cursus vitae felis et, blandit pellentesque neque. Vestibulum eget nisi a tortor commodo dignissim.\nQuisque ipsum ligula, faucibus a felis a, commodo elementum nisl. Mauris vulputate sapien et tincidunt viverra. Donec vitae velit nec metus." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -841,11 +840,11 @@ "raw": "Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -912,11 +911,11 @@ ] }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -964,11 +963,11 @@ ], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -991,11 +990,11 @@ ], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1020,11 +1019,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1049,11 +1048,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1078,11 +1077,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1099,11 +1098,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1128,11 +1127,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1157,11 +1156,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1178,13 +1177,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": null @@ -1198,13 +1195,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1293,7 +1288,7 @@ ], "cookie": [], "responseTime": "375", - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] }, @@ -1304,11 +1299,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1325,11 +1320,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1441,14 +1436,14 @@ { "expires": "Thu Mar 14 2019 13:12:10 GMT+0530 (IST)", "httpOnly": true, - "domain": "mockbin.org", + "domain": "postman-echo.com", "path": "/", "secure": false, "value": "dfb94a3e1f3f8a9956138e4896847caf21521013330", "key": "__cfduid" } ], - "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://mockbin.org/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"mockbin.org\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" + "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://postman-echo.com/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" } ] } diff --git a/codegens/http/test/resources/expected-http-messages.json b/codegens/http/test/resources/expected-http-messages.json index 9090d36c7..33258ed46 100644 --- a/codegens/http/test/resources/expected-http-messages.json +++ b/codegens/http/test/resources/expected-http-messages.json @@ -17,14 +17,14 @@ "PATCH /patch HTTP/1.1\nHost: postman-echo.com\nContent-Type: text/plain\nContent-Length: 256\n\nCurabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.", "DELETE /delete HTTP/1.1\nHost: postman-echo.com\nContent-Type: text/plain\nContent-Length: 256\n\nDonec fermentum, nisi sed cursus eleifend, nulla tortor ultricies tellus, ut vehicula orci arcu ut velit. In volutpat egestas dapibus.\nMorbi condimentum vestibulum sapien. Etiam dignissim diam quis eros lobortis gravida vel lobortis est. Etiam gravida sed.", "OPTIONS /post HTTP/1.1\nHost: postman-echo.com\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.", - "LINK /request HTTP/1.1\nHost: mockbin.org\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.", - "UNLINK /request HTTP/1.1\nHost: mockbin.org\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.", - "LOCK /request HTTP/1.1\nHost: mockbin.org\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.", - "UNLOCK /request HTTP/1.1\nHost: mockbin.org", - "PROPFIND /request HTTP/1.1\nHost: mockbin.org\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.", - "VIEW /request HTTP/1.1\nHost: mockbin.org\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.", - "PURGE / HTTP/1.1\nHost: 9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", - "COPY / HTTP/1.1\nHost: 9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "LINK /request HTTP/1.1\nHost: postman-echo.com\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.", + "UNLINK /request HTTP/1.1\nHost: postman-echo.com\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.", + "LOCK /request HTTP/1.1\nHost: postman-echo.com\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.", + "UNLOCK /request HTTP/1.1\nHost: postman-echo.com", + "PROPFIND /request HTTP/1.1\nHost: postman-echo.com\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.", + "VIEW /request HTTP/1.1\nHost: postman-echo.com\nContent-Type: text/plain\nContent-Length: 256\n\nDuis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.", + "PURGE / HTTP/1.1\nHost: postman-echo.com", + "COPY / HTTP/1.1\nHost: postman-echo.com", "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Length: 180\n\n------WebKitFormBoundary7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"file\"; filename=\"file.txt\"\nContent-Type: text/plain\n\n(data)\n------WebKitFormBoundary7MA4YWxkTrZu0gW--\n", "POST /post HTTP/1.1\nHost: postman-echo.com\nContent-Type: text/plain\nContent-Length: 22\n\n\"\"", "GET / HTTP/1.1\nHost: localhost:5050", diff --git a/codegens/http/test/resources/test-collection.json b/codegens/http/test/resources/test-collection.json index 018a37520..702e50005 100644 --- a/codegens/http/test/resources/test-collection.json +++ b/codegens/http/test/resources/test-collection.json @@ -992,7 +992,7 @@ "mode": "raw", "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, - "url": "https://mockbin.org/request" + "url": "https://postman-echo.com/request" }, "response": [] }, @@ -1010,7 +1010,7 @@ "mode": "raw", "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, - "url": "https://mockbin.org/request" + "url": "https://postman-echo.com/request" }, "response": [] }, @@ -1028,7 +1028,7 @@ "mode": "raw", "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, - "url": "https://mockbin.org/request" + "url": "https://postman-echo.com/request" }, "response": [] }, @@ -1041,7 +1041,7 @@ "mode": "raw", "raw": "" }, - "url": "https://mockbin.org/request" + "url": "https://postman-echo.com/request" }, "response": [] }, @@ -1059,7 +1059,7 @@ "mode": "raw", "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, - "url": "https://mockbin.org/request" + "url": "https://postman-echo.com/request" }, "response": [] }, @@ -1077,7 +1077,7 @@ "mode": "raw", "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, - "url": "https://mockbin.org/request" + "url": "https://postman-echo.com/request" }, "response": [] }, @@ -1090,7 +1090,7 @@ "mode": "raw", "raw": "" }, - "url": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io" + "url": "https://postman-echo.com" }, "response": [] }, @@ -1103,7 +1103,7 @@ "mode": "raw", "raw": "" }, - "url": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io" + "url": "https://postman-echo.com" }, "response": [ { @@ -1115,7 +1115,7 @@ "mode": "raw", "raw": "" }, - "url": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io" + "url": "https://postman-echo.com" }, "status": "OK", "code": 200, diff --git a/codegens/java-unirest/lib/parseRequest.js b/codegens/java-unirest/lib/parseRequest.js index 6e6053bea..1c16c66e2 100644 --- a/codegens/java-unirest/lib/parseRequest.js +++ b/codegens/java-unirest/lib/parseRequest.js @@ -3,7 +3,7 @@ var _ = require('./lodash'), sanitize = require('./util').sanitize; /** - * Encode param except the following characters- [,],% + * Encode param except the following characters- [,],%,+ * Characters { and } are kept encoded because unirest does not support them * * @param {String} param @@ -13,6 +13,7 @@ function encodeParam (param) { return encodeURIComponent(param) .replace(/%5B/g, '[') .replace(/%5D/g, ']') + .replace(/%2B/g, '+') .replace(/%25/g, '%') .replace(/'/g, '%27'); } diff --git a/codegens/java-unirest/test/unit/convert.test.js b/codegens/java-unirest/test/unit/convert.test.js index 02ff19310..eeea85a16 100644 --- a/codegens/java-unirest/test/unit/convert.test.js +++ b/codegens/java-unirest/test/unit/convert.test.js @@ -174,7 +174,7 @@ describe('java unirest convert function for test collection', function () { 'six HTTP methods', function () { reqObject = { 'description': 'This is a sample PROPFIND request', - 'url': 'https://mockbin.org/request', + 'url': 'https://postman-echo.com/request', 'method': 'PROPFIND' }; request = new sdk.Request(reqObject); @@ -302,10 +302,10 @@ describe('java unirest convert function for test collection', function () { ] }, 'url': { - 'raw': 'https://postman-echo/', + 'raw': 'https://postman-echo.com/', 'protocol': 'https', 'host': [ - 'google', + 'postman-echo', 'com' ] } @@ -341,10 +341,10 @@ describe('java unirest convert function for test collection', function () { ] }, 'url': { - 'raw': 'https://postman-echo/', + 'raw': 'https://postman-echo.com/', 'protocol': 'https', 'host': [ - 'google', + 'postman-echo', 'com' ] } @@ -500,12 +500,12 @@ describe('java unirest convert function for test collection', function () { it('should not encode unresolved query params and ' + 'encode every other query param, both present together', function () { - rawUrl = 'https://postman-echo.com/get?key1={{value}}&key2=\'a b c\''; + rawUrl = 'https://postman-echo.com/get?key1={{value}}&key2=\'a b+c\''; urlObject = new sdk.Url(rawUrl); outputUrlString = getUrlStringfromUrlObject(urlObject); expect(outputUrlString).to.include('key1=%7B%7Bvalue%7D%7D'); - expect(outputUrlString).to.not.include('key2=\'a b c\''); - expect(outputUrlString).to.equal('https://postman-echo.com/get?key1=%7B%7Bvalue%7D%7D&key2=%27a%20b%20c%27'); + expect(outputUrlString).to.not.include('key2=\'a b+c\''); + expect(outputUrlString).to.equal('https://postman-echo.com/get?key1=%7B%7Bvalue%7D%7D&key2=%27a%20b+c%27'); }); it('should discard disabled query params', function () { diff --git a/codegens/js-fetch/test/unit/convert.test.js b/codegens/js-fetch/test/unit/convert.test.js index 34b10e8f3..352aaecdf 100644 --- a/codegens/js-fetch/test/unit/convert.test.js +++ b/codegens/js-fetch/test/unit/convert.test.js @@ -133,11 +133,11 @@ describe('js-fetch convert function for test collection', function () { request = new sdk.Request({ 'method': 'GET', 'url': { - 'raw': 'https://mockbin.org/request', + 'raw': 'https://postman-echo.com/request', 'protocol': 'https', 'host': [ - 'mockbin', - 'org' + 'postman-echo', + 'com' ], 'path': [ 'request' diff --git a/codegens/js-fetch/test/unit/fixtures/testcollection/collection.json b/codegens/js-fetch/test/unit/fixtures/testcollection/collection.json index f70342d69..32c12564b 100644 --- a/codegens/js-fetch/test/unit/fixtures/testcollection/collection.json +++ b/codegens/js-fetch/test/unit/fixtures/testcollection/collection.json @@ -49,11 +49,11 @@ ], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -123,11 +123,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request?test=123&anotherone=232", + "raw": "https://postman-echo.com/request?test=123&anotherone=232", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -197,11 +197,11 @@ "raw": "\"'Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, \"id\" \"se\\\"mper\" sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.'\"" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -369,11 +369,11 @@ ] }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -431,11 +431,11 @@ "raw": "{\n \"json\": \"Test-Test\"\n}" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -616,11 +616,11 @@ "raw": "var val = 6;\nconsole.log(val);" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -671,11 +671,11 @@ "raw": "\n Test Test\n" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -726,11 +726,11 @@ "raw": "\n Test Test\n" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -755,14 +755,13 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request/:action", + "raw": "https://postman-echo.com/:action", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ - "request", ":action" ], "variable": [ @@ -815,11 +814,11 @@ "raw": "Etiam mi lacus, cursus vitae felis et, blandit pellentesque neque. Vestibulum eget nisi a tortor commodo dignissim.\nQuisque ipsum ligula, faucibus a felis a, commodo elementum nisl. Mauris vulputate sapien et tincidunt viverra. Donec vitae velit nec metus." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -868,11 +867,11 @@ "raw": "Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -939,11 +938,11 @@ ] }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -991,11 +990,11 @@ ], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1018,11 +1017,11 @@ ], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1047,11 +1046,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1076,11 +1075,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1105,11 +1104,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1126,11 +1125,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1155,11 +1154,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1184,11 +1183,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1205,13 +1204,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": null @@ -1225,13 +1222,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1320,7 +1315,7 @@ ], "cookie": [], "responseTime": "375", - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] }, @@ -1331,11 +1326,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1352,11 +1347,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1468,14 +1463,14 @@ { "expires": "Thu Mar 14 2019 13:12:10 GMT+0530 (IST)", "httpOnly": true, - "domain": "mockbin.org", + "domain": "postman-echo.com", "path": "/", "secure": false, "value": "dfb94a3e1f3f8a9956138e4896847caf21521013330", "key": "__cfduid" } ], - "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://mockbin.org/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"mockbin.org\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" + "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://postman-echo.com/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" } ] } diff --git a/codegens/js-jquery/test/unit/fixtures/sample_collection.json b/codegens/js-jquery/test/unit/fixtures/sample_collection.json index 597792d08..d7f23f1f2 100644 --- a/codegens/js-jquery/test/unit/fixtures/sample_collection.json +++ b/codegens/js-jquery/test/unit/fixtures/sample_collection.json @@ -1147,11 +1147,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1175,11 +1175,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1203,11 +1203,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1226,11 +1226,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1254,11 +1254,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1282,11 +1282,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1305,13 +1305,11 @@ "raw": "" }, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1327,13 +1325,11 @@ "raw": "" }, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1349,13 +1345,11 @@ "raw": "" }, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, diff --git a/codegens/js-jquery/test/unit/fixtures/snippetFixtures.json b/codegens/js-jquery/test/unit/fixtures/snippetFixtures.json index 27181db6f..65beeafe3 100644 --- a/codegens/js-jquery/test/unit/fixtures/snippetFixtures.json +++ b/codegens/js-jquery/test/unit/fixtures/snippetFixtures.json @@ -16,12 +16,12 @@ "PATCH Request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//postman-echo.com/patch%22%2C%0A%20%20%20%20%22method%22%3A%20%22PATCH%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Curabitur%20auctor%2C%20elit%20nec%20pulvinar%20porttitor%2C%20ex%20augue%20condimentum%20enim%2C%20eget%20suscipit%20urna%20felis%20quis%20neque.%5CnSuspendisse%20sit%20amet%20luctus%20massa%2C%20nec%20venenatis%20mi.%20Suspendisse%20tincidunt%20massa%20at%20nibh%20efficitur%20fringilla.%20Nam%20quis%20congue%20mi.%20Etiam%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", "DELETE Request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//postman-echo.com/delete%22%2C%0A%20%20%20%20%22method%22%3A%20%22DELETE%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Donec%20fermentum%2C%20nisi%20sed%20cursus%20eleifend%2C%20nulla%20tortor%20ultricies%20tellus%2C%20ut%20vehicula%20orci%20arcu%20ut%20velit.%20In%20volutpat%20egestas%20dapibus.%5CnMorbi%20condimentum%20vestibulum%20sapien.%20Etiam%20dignissim%20diam%20quis%20eros%20lobortis%20gravida%20vel%20lobortis%20est.%20Etiam%20gravida%20sed.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", "OPTIONS to postman echo": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//postman-echo.com/post%22%2C%0A%20%20%20%20%22method%22%3A%20%22OPTIONS%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Duis%20posuere%20augue%20vel%20cursus%20pharetra.%20In%20luctus%20a%20ex%20nec%20pretium.%20Praesent%20neque%20quam%2C%20tincidunt%20nec%20leo%20eget%2C%20rutrum%20vehicula%20magna.%5CnMaecenas%20consequat%20elementum%20elit%2C%20id%20semper%20sem%20tristique%20et.%20Integer%20pulvinar%20enim%20quis%20consectetur%20interdum%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", - "LINK request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//mockbin.org/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22LINK%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Duis%20posuere%20augue%20vel%20cursus%20pharetra.%20In%20luctus%20a%20ex%20nec%20pretium.%20Praesent%20neque%20quam%2C%20tincidunt%20nec%20leo%20eget%2C%20rutrum%20vehicula%20magna.%5CnMaecenas%20consequat%20elementum%20elit%2C%20id%20semper%20sem%20tristique%20et.%20Integer%20pulvinar%20enim%20quis%20consectetur%20interdum%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", - "UNLINK request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//mockbin.org/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22UNLINK%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Duis%20posuere%20augue%20vel%20cursus%20pharetra.%20In%20luctus%20a%20ex%20nec%20pretium.%20Praesent%20neque%20quam%2C%20tincidunt%20nec%20leo%20eget%2C%20rutrum%20vehicula%20magna.%5CnMaecenas%20consequat%20elementum%20elit%2C%20id%20semper%20sem%20tristique%20et.%20Integer%20pulvinar%20enim%20quis%20consectetur%20interdum%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", - "LOCK request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//mockbin.org/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22LOCK%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Duis%20posuere%20augue%20vel%20cursus%20pharetra.%20In%20luctus%20a%20ex%20nec%20pretium.%20Praesent%20neque%20quam%2C%20tincidunt%20nec%20leo%20eget%2C%20rutrum%20vehicula%20magna.%5CnMaecenas%20consequat%20elementum%20elit%2C%20id%20semper%20sem%20tristique%20et.%20Integer%20pulvinar%20enim%20quis%20consectetur%20interdum%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", - "UNLOCK request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//mockbin.org/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22UNLOCK%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", - "PROPFIND request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//mockbin.org/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22PROPFIND%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Duis%20posuere%20augue%20vel%20cursus%20pharetra.%20In%20luctus%20a%20ex%20nec%20pretium.%20Praesent%20neque%20quam%2C%20tincidunt%20nec%20leo%20eget%2C%20rutrum%20vehicula%20magna.%5CnMaecenas%20consequat%20elementum%20elit%2C%20id%20semper%20sem%20tristique%20et.%20Integer%20pulvinar%20enim%20quis%20consectetur%20interdum%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", - "VIEW request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//mockbin.org/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22VIEW%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Duis%20posuere%20augue%20vel%20cursus%20pharetra.%20In%20luctus%20a%20ex%20nec%20pretium.%20Praesent%20neque%20quam%2C%20tincidunt%20nec%20leo%20eget%2C%20rutrum%20vehicula%20magna.%5CnMaecenas%20consequat%20elementum%20elit%2C%20id%20semper%20sem%20tristique%20et.%20Integer%20pulvinar%20enim%20quis%20consectetur%20interdum%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", - "PURGE Request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io%22%2C%0A%20%20%20%20%22method%22%3A%20%22PURGE%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", - "COPY Request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io%22%2C%0A%20%20%20%20%22method%22%3A%20%22COPY%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B" + "LINK request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//postman-echo.com/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22LINK%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Duis%20posuere%20augue%20vel%20cursus%20pharetra.%20In%20luctus%20a%20ex%20nec%20pretium.%20Praesent%20neque%20quam%2C%20tincidunt%20nec%20leo%20eget%2C%20rutrum%20vehicula%20magna.%5CnMaecenas%20consequat%20elementum%20elit%2C%20id%20semper%20sem%20tristique%20et.%20Integer%20pulvinar%20enim%20quis%20consectetur%20interdum%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", + "UNLINK request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//postman-echo.com/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22UNLINK%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Duis%20posuere%20augue%20vel%20cursus%20pharetra.%20In%20luctus%20a%20ex%20nec%20pretium.%20Praesent%20neque%20quam%2C%20tincidunt%20nec%20leo%20eget%2C%20rutrum%20vehicula%20magna.%5CnMaecenas%20consequat%20elementum%20elit%2C%20id%20semper%20sem%20tristique%20et.%20Integer%20pulvinar%20enim%20quis%20consectetur%20interdum%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", + "LOCK request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//postman-echo.com/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22LOCK%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Duis%20posuere%20augue%20vel%20cursus%20pharetra.%20In%20luctus%20a%20ex%20nec%20pretium.%20Praesent%20neque%20quam%2C%20tincidunt%20nec%20leo%20eget%2C%20rutrum%20vehicula%20magna.%5CnMaecenas%20consequat%20elementum%20elit%2C%20id%20semper%20sem%20tristique%20et.%20Integer%20pulvinar%20enim%20quis%20consectetur%20interdum%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", + "UNLOCK request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//postman-echo.com/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22UNLOCK%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", + "PROPFIND request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//postman-echo.com/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22PROPFIND%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Duis%20posuere%20augue%20vel%20cursus%20pharetra.%20In%20luctus%20a%20ex%20nec%20pretium.%20Praesent%20neque%20quam%2C%20tincidunt%20nec%20leo%20eget%2C%20rutrum%20vehicula%20magna.%5CnMaecenas%20consequat%20elementum%20elit%2C%20id%20semper%20sem%20tristique%20et.%20Integer%20pulvinar%20enim%20quis%20consectetur%20interdum%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", + "VIEW request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//postman-echo.com/request%22%2C%0A%20%20%20%20%22method%22%3A%20%22VIEW%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%20%20%20%20%22headers%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22Content-Type%22%3A%20%22text/plain%22%0A%20%20%20%20%7D%2C%0A%20%20%20%20%22data%22%3A%20%22Duis%20posuere%20augue%20vel%20cursus%20pharetra.%20In%20luctus%20a%20ex%20nec%20pretium.%20Praesent%20neque%20quam%2C%20tincidunt%20nec%20leo%20eget%2C%20rutrum%20vehicula%20magna.%5CnMaecenas%20consequat%20elementum%20elit%2C%20id%20semper%20sem%20tristique%20et.%20Integer%20pulvinar%20enim%20quis%20consectetur%20interdum%20volutpat.%22%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", + "PURGE Request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//postman-echo.com%22%2C%0A%20%20%20%20%22method%22%3A%20%22PURGE%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B", + "COPY Request": "var%20settings%20%3D%20%7B%0A%20%20%20%20%22url%22%3A%20%22https%3A//postman-echo.com%22%2C%0A%20%20%20%20%22method%22%3A%20%22COPY%22%2C%0A%20%20%20%20%22timeout%22%3A%20100%2C%0A%7D%3B%0A%0A%24.ajax%28settings%29.done%28function%20%28response%29%20%7B%0A%20%20%20%20console.log%28response%29%3B%0A%7D%29%3B" } diff --git a/codegens/js-xhr/lib/util.js b/codegens/js-xhr/lib/util.js index 525862b57..94fb47ac7 100644 --- a/codegens/js-xhr/lib/util.js +++ b/codegens/js-xhr/lib/util.js @@ -158,7 +158,7 @@ const self = module.exports = { }, /** - * Encode param except the following characters- [,{,},],% + * Encode param except the following characters- [,{,},],%,+ * * @param {String} param * @returns {String} @@ -169,6 +169,7 @@ const self = module.exports = { .replace(/%7B/g, '{') .replace(/%5D/g, ']') .replace(/%7D/g, '}') + .replace(/%2B/g, '+') .replace(/%25/g, '%') .replace(/'/g, '%27'); }, diff --git a/codegens/js-xhr/test/unit/convert.test.js b/codegens/js-xhr/test/unit/convert.test.js index c36f2226d..c972d8656 100644 --- a/codegens/js-xhr/test/unit/convert.test.js +++ b/codegens/js-xhr/test/unit/convert.test.js @@ -1,7 +1,7 @@ var expect = require('chai').expect, sdk = require('postman-collection'), sanitize = require('../../lib/util.js').sanitize, - + getUrlStringfromUrlObject = require('../../lib/util').getUrlStringfromUrlObject, convert = require('../../index').convert, getOptions = require('../../index').getOptions; @@ -162,6 +162,15 @@ describe('js-xhr convert function', function () { it('should trim input string when needed', function () { expect(sanitize('inputString ', true)).to.equal('inputString'); }); + it('should not encode unresolved query params and ' + + 'encode every other query param, both present together', function () { + let rawUrl = 'https://postman-echo.com/get?key1={{value}}&key2=\'a b+c\'', + urlObject = new sdk.Url(rawUrl), + outputUrlString = getUrlStringfromUrlObject(urlObject); + expect(outputUrlString).to.not.include('key1=%7B%7Bvalue%7B%7B'); + expect(outputUrlString).to.not.include('key2=\'a b+c\''); + expect(outputUrlString).to.equal('https://postman-echo.com/get?key1={{value}}&key2=%27a%20b+c%27'); + }); }); describe('POST Form data Request', function () { diff --git a/codegens/js-xhr/test/unit/fixtures/testcollection/collection.json b/codegens/js-xhr/test/unit/fixtures/testcollection/collection.json index e1d75d11b..04db3c624 100644 --- a/codegens/js-xhr/test/unit/fixtures/testcollection/collection.json +++ b/codegens/js-xhr/test/unit/fixtures/testcollection/collection.json @@ -961,11 +961,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -990,11 +990,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1019,11 +1019,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1040,11 +1040,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1069,11 +1069,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1098,11 +1098,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1119,13 +1119,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": null @@ -1139,13 +1137,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1234,7 +1230,7 @@ ], "cookie": [], "responseTime": "375", - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] }, @@ -1245,11 +1241,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1266,11 +1262,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1382,14 +1378,14 @@ { "expires": "Thu Mar 14 2019 13:12:10 GMT+0530 (IST)", "httpOnly": true, - "domain": "mockbin.org", + "domain": "postman-echo.com", "path": "/", "secure": false, "value": "dfb94a3e1f3f8a9956138e4896847caf21521013330", "key": "__cfduid" } ], - "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://mockbin.org/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"mockbin.org\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" + "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://postman-echo.com/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" } ] } diff --git a/codegens/libcurl/lib/util.js b/codegens/libcurl/lib/util.js index ddc8cfce0..e81f6187d 100644 --- a/codegens/libcurl/lib/util.js +++ b/codegens/libcurl/lib/util.js @@ -160,7 +160,7 @@ const self = module.exports = { }, /** - * Encode param except the following characters- [,{,},],% + * Encode param except the following characters- [,{,},],%,+ * * @param {String} param * @returns {String} @@ -171,6 +171,7 @@ const self = module.exports = { .replace(/%7B/g, '{') .replace(/%5D/g, ']') .replace(/%7D/g, '}') + .replace(/%2B/g, '+') .replace(/%25/g, '%') .replace(/'/g, '%27'); }, diff --git a/codegens/libcurl/test/unit/convert.test.js b/codegens/libcurl/test/unit/convert.test.js index 5ff1e9630..57b33f02c 100644 --- a/codegens/libcurl/test/unit/convert.test.js +++ b/codegens/libcurl/test/unit/convert.test.js @@ -2,6 +2,7 @@ var expect = require('chai').expect, sdk = require('postman-collection'), convert = require('../../index').convert, getOptions = require('../../index').getOptions, + getUrlStringfromUrlObject = require('../../lib/util').getUrlStringfromUrlObject, sanitize = require('../../lib/util').sanitize, mainCollection = require('../../../../test/codegen/newman/fixtures/basicCollection.json'); @@ -207,5 +208,14 @@ describe('libcurl convert function', function () { expect(sanitize('inputString ', true)).to.equal('inputString'); }); + it('should not encode unresolved query params and ' + + 'encode every other query param, both present together', function () { + let rawUrl = 'https://postman-echo.com/get?key1={{value}}&key2=\'a b+c\'', + urlObject = new sdk.Url(rawUrl), + outputUrlString = getUrlStringfromUrlObject(urlObject); + expect(outputUrlString).to.not.include('key1=%7B%7Bvalue%7B%7B'); + expect(outputUrlString).to.not.include('key2=\'a b+c\''); + expect(outputUrlString).to.equal('https://postman-echo.com/get?key1={{value}}&key2=%27a%20b+c%27'); + }); }); }); diff --git a/codegens/libcurl/test/unit/fixtures/testcollection/collection.json b/codegens/libcurl/test/unit/fixtures/testcollection/collection.json index a9581bb55..7a857e0f1 100644 --- a/codegens/libcurl/test/unit/fixtures/testcollection/collection.json +++ b/codegens/libcurl/test/unit/fixtures/testcollection/collection.json @@ -1047,11 +1047,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1076,11 +1076,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1105,11 +1105,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1126,11 +1126,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1155,11 +1155,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1184,11 +1184,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1205,13 +1205,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": null @@ -1225,13 +1223,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1320,7 +1316,7 @@ ], "cookie": [], "responseTime": "375", - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] }, @@ -1331,11 +1327,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1352,11 +1348,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1468,14 +1464,14 @@ { "expires": "Thu Mar 14 2019 13:12:10 GMT+0530 (IST)", "httpOnly": true, - "domain": "mockbin.org", + "domain": "postman-echo.com", "path": "/", "secure": false, "value": "dfb94a3e1f3f8a9956138e4896847caf21521013330", "key": "__cfduid" } ], - "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://mockbin.org/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"mockbin.org\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" + "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://postman-echo.com/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" } ] } diff --git a/codegens/nodejs-axios/test/unit/fixtures/testcollection/collection.json b/codegens/nodejs-axios/test/unit/fixtures/testcollection/collection.json index 186aa9ce5..82e46b24f 100644 --- a/codegens/nodejs-axios/test/unit/fixtures/testcollection/collection.json +++ b/codegens/nodejs-axios/test/unit/fixtures/testcollection/collection.json @@ -991,13 +991,11 @@ ], "body": {}, "url": { - "raw": "https://bf1621bb-f962-46b8-bf28-459e03b513ff.mock.pstmn.io/head", + "raw": "https://postman-echo.com/head", "protocol": "https", "host": [ - "bf1621bb-f962-46b8-bf28-459e03b513ff", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path": [ "head" @@ -1022,11 +1020,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1051,11 +1049,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1080,11 +1078,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1101,11 +1099,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1130,11 +1128,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1159,11 +1157,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1180,13 +1178,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": null @@ -1200,13 +1196,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1295,7 +1289,7 @@ ], "cookie": [], "responseTime": "375", - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] }, @@ -1306,13 +1300,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1325,13 +1317,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1341,7 +1331,7 @@ "header": [], "cookie": [], "responseTime": "0", - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] } diff --git a/codegens/nodejs-native/test/unit/fixtures/testcollection/collection.json b/codegens/nodejs-native/test/unit/fixtures/testcollection/collection.json index a28abdba7..febbfd3e0 100644 --- a/codegens/nodejs-native/test/unit/fixtures/testcollection/collection.json +++ b/codegens/nodejs-native/test/unit/fixtures/testcollection/collection.json @@ -163,13 +163,11 @@ "header": [], "body": {}, "url": { - "raw": "https://89c918b1-f4f8-4812-8e6c-69ecbeeb8409.mock.pstmn.io?query1=1&query2=2", + "raw": "https://postman-echo.com?query1=1&query2=2", "protocol": "https", "host": [ - "89c918b1-f4f8-4812-8e6c-69ecbeeb8409", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path": [], "query": [ @@ -1051,14 +1049,12 @@ ], "body": {}, "url": { - "raw": "https://bf1621bb-f962-46b8-bf28-459e03b513ff.mock.pstmn.io/head", + "raw": "https://postman-echo.com/head", "protocol": "https", "host": [ - "bf1621bb-f962-46b8-bf28-459e03b513ff", - "mock", - "pstmn", - "io" - ], + "postman-echo", + "com" + ], "path": [ "head" ] @@ -1082,11 +1078,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1111,11 +1107,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1140,11 +1136,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1161,11 +1157,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1190,11 +1186,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1219,11 +1215,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1240,13 +1236,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": null @@ -1260,13 +1254,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1355,7 +1347,7 @@ ], "cookie": [], "responseTime": "375", - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] }, @@ -1366,13 +1358,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1385,13 +1375,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1401,7 +1389,7 @@ "header": [], "cookie": [], "responseTime": "0", - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] } diff --git a/codegens/nodejs-native/test/unit/snippet.test.js b/codegens/nodejs-native/test/unit/snippet.test.js index 9330554cb..6f2109a6c 100644 --- a/codegens/nodejs-native/test/unit/snippet.test.js +++ b/codegens/nodejs-native/test/unit/snippet.test.js @@ -9,13 +9,11 @@ describe('nodejs-native convert function', function () { 'header': [], 'body': {}, 'url': { - 'raw': 'https://89c918b1-f4f8-4812-8e6c-69ecbeeb8409.mock.pstmn.io?query1=1&query2=2', + 'raw': 'https://postman-echo.com?query1=1&query2=2', 'protocol': 'https', 'host': [ - '89c918b1-f4f8-4812-8e6c-69ecbeeb8409', - 'mock', - 'pstmn', - 'io' + 'postman-echo', + 'com' ], 'path': [], 'query': [ diff --git a/codegens/nodejs-request/test/unit/fixtures/testcollection/collection.json b/codegens/nodejs-request/test/unit/fixtures/testcollection/collection.json index 186aa9ce5..82e46b24f 100644 --- a/codegens/nodejs-request/test/unit/fixtures/testcollection/collection.json +++ b/codegens/nodejs-request/test/unit/fixtures/testcollection/collection.json @@ -991,13 +991,11 @@ ], "body": {}, "url": { - "raw": "https://bf1621bb-f962-46b8-bf28-459e03b513ff.mock.pstmn.io/head", + "raw": "https://postman-echo.com/head", "protocol": "https", "host": [ - "bf1621bb-f962-46b8-bf28-459e03b513ff", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path": [ "head" @@ -1022,11 +1020,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1051,11 +1049,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1080,11 +1078,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1101,11 +1099,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1130,11 +1128,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1159,11 +1157,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1180,13 +1178,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": null @@ -1200,13 +1196,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1295,7 +1289,7 @@ ], "cookie": [], "responseTime": "375", - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] }, @@ -1306,13 +1300,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1325,13 +1317,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1341,7 +1331,7 @@ "header": [], "cookie": [], "responseTime": "0", - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] } diff --git a/codegens/nodejs-unirest/test/unit/fixtures/testcollection/collection.json b/codegens/nodejs-unirest/test/unit/fixtures/testcollection/collection.json index 5af24b1f8..09590eacb 100644 --- a/codegens/nodejs-unirest/test/unit/fixtures/testcollection/collection.json +++ b/codegens/nodejs-unirest/test/unit/fixtures/testcollection/collection.json @@ -978,11 +978,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1006,11 +1006,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1034,11 +1034,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1054,11 +1054,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1082,11 +1082,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1101,11 +1101,11 @@ "method": "PURGE", "header": [], "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1121,11 +1121,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1141,11 +1141,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1257,14 +1257,14 @@ { "expires": "Thu Mar 14 2019 13:12:10 GMT+0530 (IST)", "httpOnly": true, - "domain": "mockbin.org", + "domain": "postman-echo.com", "path": "/", "secure": false, "value": "dfb94a3e1f3f8a9956138e4896847caf21521013330", "key": "__cfduid" } ], - "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://mockbin.org/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"mockbin.org\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" + "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://postman-echo.com/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" } ] } diff --git a/codegens/objective-c/test/unit/fixtures/collection.json b/codegens/objective-c/test/unit/fixtures/collection.json index 336aee830..832f1007e 100644 --- a/codegens/objective-c/test/unit/fixtures/collection.json +++ b/codegens/objective-c/test/unit/fixtures/collection.json @@ -37,11 +37,11 @@ } ], "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -848,11 +848,11 @@ "method": "LINK", "header": [], "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -876,11 +876,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -904,11 +904,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -923,11 +923,11 @@ "method": "UNLOCK", "header": [], "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -951,11 +951,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -970,11 +970,11 @@ "method": "PURGE", "header": [], "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -989,11 +989,11 @@ "method": "COPY", "header": [], "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1007,13 +1007,11 @@ "method": "COPY", "header": [], "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, diff --git a/codegens/objective-c/test/unit/fixtures/snippets.json b/codegens/objective-c/test/unit/fixtures/snippets.json index f97ac73fa..1cd851a88 100644 --- a/codegens/objective-c/test/unit/fixtures/snippets.json +++ b/codegens/objective-c/test/unit/fixtures/snippets.json @@ -1,5 +1,5 @@ { - "Request Headers": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://mockbin.org/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"my-sample-header\": @\"Lorem ipsum dolor sit amet\",\n @\"testing\": @\"'singlequotes'\",\n @\"TEST\": @\"\\\"doublequotes\\\"\"\n};\n\n[request setAllHTTPHeaderFields:headers];\n\n[request setHTTPMethod:@\"POST\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", + "Request Headers": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"my-sample-header\": @\"Lorem ipsum dolor sit amet\",\n @\"testing\": @\"'singlequotes'\",\n @\"TEST\": @\"\\\"doublequotes\\\"\"\n};\n\n[request setAllHTTPHeaderFields:headers];\n\n[request setHTTPMethod:@\"POST\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", "Request Headers (With special Characters)": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/headers\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"my-sample-header\": @\"Lorem ipsum dolor sit amet\",\n @\"TEST\": @\"@#$%^&*()\",\n @\"more\": @\",./';[]}{\\\":?><|\\\\\\\\\"\n};\n\n[request setAllHTTPHeaderFields:headers];\n\n[request setHTTPMethod:@\"GET\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", "Request Headers with disabled headers": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/headers\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"my-sample-header\": @\"Lorem ipsum dolor sit amet\",\n @\"not-disabled-header\": @\"ENABLED\"\n};\n\n[request setAllHTTPHeaderFields:headers];\n\n[request setHTTPMethod:@\"GET\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", "GET Request with disabled query": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/get?test=123&anotherone=232\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n\n[request setHTTPMethod:@\"GET\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", @@ -14,13 +14,13 @@ "PATCH Request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/patch\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"Content-Type\": @\"text/plain\"\n};\n\n[request setAllHTTPHeaderFields:headers];\nNSData *postData = [[NSData alloc] initWithData:[@\"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\" dataUsingEncoding:NSUTF8StringEncoding]];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"PATCH\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", "DELETE Request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/delete\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"Content-Type\": @\"text/plain\"\n};\n\n[request setAllHTTPHeaderFields:headers];\nNSData *postData = [[NSData alloc] initWithData:[@\"Donec fermentum, nisi sed cursus eleifend, nulla tortor ultricies tellus, ut vehicula orci arcu ut velit. In volutpat egestas dapibus.\\nMorbi condimentum vestibulum sapien. Etiam dignissim diam quis eros lobortis gravida vel lobortis est. Etiam gravida sed.\" dataUsingEncoding:NSUTF8StringEncoding]];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"DELETE\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", "OPTIONS to postman echo": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/post\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"Content-Type\": @\"text/plain\"\n};\n\n[request setAllHTTPHeaderFields:headers];\nNSData *postData = [[NSData alloc] initWithData:[@\"Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.\" dataUsingEncoding:NSUTF8StringEncoding]];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"OPTIONS\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", - "LINK request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://mockbin.org/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n\n[request setHTTPMethod:@\"LINK\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", - "UNLINK request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://mockbin.org/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"Content-Type\": @\"text/plain\"\n};\n\n[request setAllHTTPHeaderFields:headers];\nNSData *postData = [[NSData alloc] initWithData:[@\"Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.\" dataUsingEncoding:NSUTF8StringEncoding]];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"UNLINK\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", - "LOCK request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://mockbin.org/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"Content-Type\": @\"text/plain\"\n};\n\n[request setAllHTTPHeaderFields:headers];\nNSData *postData = [[NSData alloc] initWithData:[@\"Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.\" dataUsingEncoding:NSUTF8StringEncoding]];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"LOCK\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", - "UNLOCK request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://mockbin.org/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n\n[request setHTTPMethod:@\"UNLOCK\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", - "PROPFIND request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://mockbin.org/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"Content-Type\": @\"text/plain\"\n};\n\n[request setAllHTTPHeaderFields:headers];\nNSData *postData = [[NSData alloc] initWithData:[@\"Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.\" dataUsingEncoding:NSUTF8StringEncoding]];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"PROPFIND\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", - "PURGE Request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://mockbin.org/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n\n[request setHTTPMethod:@\"PURGE\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", - "COPY Request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://mockbin.org/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n\n[request setHTTPMethod:@\"COPY\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", + "LINK request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n\n[request setHTTPMethod:@\"LINK\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", + "UNLINK request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"Content-Type\": @\"text/plain\"\n};\n\n[request setAllHTTPHeaderFields:headers];\nNSData *postData = [[NSData alloc] initWithData:[@\"Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.\" dataUsingEncoding:NSUTF8StringEncoding]];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"UNLINK\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", + "LOCK request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"Content-Type\": @\"text/plain\"\n};\n\n[request setAllHTTPHeaderFields:headers];\nNSData *postData = [[NSData alloc] initWithData:[@\"Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.\" dataUsingEncoding:NSUTF8StringEncoding]];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"LOCK\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", + "UNLOCK request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n\n[request setHTTPMethod:@\"UNLOCK\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", + "PROPFIND request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSDictionary *headers = @{\n @\"Content-Type\": @\"text/plain\"\n};\n\n[request setAllHTTPHeaderFields:headers];\nNSData *postData = [[NSData alloc] initWithData:[@\"Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.\" dataUsingEncoding:NSUTF8StringEncoding]];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"PROPFIND\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", + "PURGE Request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n\n[request setHTTPMethod:@\"PURGE\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", + "COPY Request": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/request\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\n\n[request setHTTPMethod:@\"COPY\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", "Post file": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/post\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSArray *parameters = @[\n @{ @\"name\": @\"uohou\", @\"fileName\": @\"/Users/umesh/Desktop/Screenshot 2019-09-29 at 10.50.30 AM.png\" } \n];\n\nNSString *boundary = @\"----WebKitFormBoundary7MA4YWxkTrZu0gW\";\nNSError *error;\nNSMutableString *body = [NSMutableString string];\n\nfor (NSDictionary *param in parameters) {\n [body appendFormat:@\"--%@\\r\\n\", boundary];\n if (param[@\"fileName\"]) {\n [body appendFormat:@\"Content-Disposition:form-data; name=\\\"%@\\\"; filename=\\\"%@\\\"\\r\\n\", param[@\"name\"], param[@\"fileName\"]];\n [body appendFormat:@\"Content-Type: %@\\r\\n\\r\\n\", param[@\"contentType\"]];\n [body appendFormat:@\"%@\", [NSString stringWithContentsOfFile:param[@\"fileName\"] encoding:NSUTF8StringEncoding error:&error]];\n if (error) {\n NSLog(@\"%@\", error);\n }\n } else {\n [body appendFormat:@\"Content-Disposition:form-data; name=\\\"%@\\\"\\r\\n\\r\\n\", param[@\"name\"]];\n [body appendFormat:@\"%@\", param[@\"value\"]];\n }\n}\n[body appendFormat:@\"\\r\\n--%@--\\r\\n\", boundary];\nNSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"POST\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", "Post multiple files in the same parameter via form-data": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/post\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSArray *parameters = @[\n @{ @\"name\": @\"multiple files\", @\"fileName\": @\"/Users/shreyshah/Desktop/openapi3.json\" }, \n @{ @\"name\": @\"multiple files\", @\"fileName\": @\"/Users/shreyshah/Desktop/openapi3.yaml\" } \n];\n\nNSString *boundary = @\"----WebKitFormBoundary7MA4YWxkTrZu0gW\";\nNSError *error;\nNSMutableString *body = [NSMutableString string];\n\nfor (NSDictionary *param in parameters) {\n [body appendFormat:@\"--%@\\r\\n\", boundary];\n if (param[@\"fileName\"]) {\n [body appendFormat:@\"Content-Disposition:form-data; name=\\\"%@\\\"; filename=\\\"%@\\\"\\r\\n\", param[@\"name\"], param[@\"fileName\"]];\n [body appendFormat:@\"Content-Type: %@\\r\\n\\r\\n\", param[@\"contentType\"]];\n [body appendFormat:@\"%@\", [NSString stringWithContentsOfFile:param[@\"fileName\"] encoding:NSUTF8StringEncoding error:&error]];\n if (error) {\n NSLog(@\"%@\", error);\n }\n } else {\n [body appendFormat:@\"Content-Disposition:form-data; name=\\\"%@\\\"\\r\\n\\r\\n\", param[@\"name\"]];\n [body appendFormat:@\"%@\", param[@\"value\"]];\n }\n}\n[body appendFormat:@\"\\r\\n--%@--\\r\\n\", boundary];\nNSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"POST\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", "Post a file via form-data, without file src specified": "#import \n\ndispatch_semaphore_t sema = dispatch_semaphore_create(0);\n\nNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://postman-echo.com/post\"]\n cachePolicy:NSURLRequestUseProtocolCachePolicy\n timeoutInterval:10.0];\nNSArray *parameters = @[\n @{ @\"name\": @\"key\", @\"fileName\": @\"/path/to/file\" } \n];\n\nNSString *boundary = @\"----WebKitFormBoundary7MA4YWxkTrZu0gW\";\nNSError *error;\nNSMutableString *body = [NSMutableString string];\n\nfor (NSDictionary *param in parameters) {\n [body appendFormat:@\"--%@\\r\\n\", boundary];\n if (param[@\"fileName\"]) {\n [body appendFormat:@\"Content-Disposition:form-data; name=\\\"%@\\\"; filename=\\\"%@\\\"\\r\\n\", param[@\"name\"], param[@\"fileName\"]];\n [body appendFormat:@\"Content-Type: %@\\r\\n\\r\\n\", param[@\"contentType\"]];\n [body appendFormat:@\"%@\", [NSString stringWithContentsOfFile:param[@\"fileName\"] encoding:NSUTF8StringEncoding error:&error]];\n if (error) {\n NSLog(@\"%@\", error);\n }\n } else {\n [body appendFormat:@\"Content-Disposition:form-data; name=\\\"%@\\\"\\r\\n\\r\\n\", param[@\"name\"]];\n [body appendFormat:@\"%@\", param[@\"value\"]];\n }\n}\n[body appendFormat:@\"\\r\\n--%@--\\r\\n\", boundary];\nNSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];\n[request setHTTPBody:postData];\n\n[request setHTTPMethod:@\"POST\"];\n\nNSURLSession *session = [NSURLSession sharedSession];\nNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\ncompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\n if (error) {\n NSLog(@\"%@\", error);\n dispatch_semaphore_signal(sema);\n } else {\n NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\n NSError *parseError = nil;\n NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];\n NSLog(@\"%@\",responseDictionary);\n dispatch_semaphore_signal(sema);\n }\n}];\n[dataTask resume];\ndispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);", diff --git a/codegens/ocaml-cohttp/lib/util.js b/codegens/ocaml-cohttp/lib/util.js index 7cd812e17..e23d4c5be 100644 --- a/codegens/ocaml-cohttp/lib/util.js +++ b/codegens/ocaml-cohttp/lib/util.js @@ -184,6 +184,7 @@ const self = module.exports = { .replace(/%7B/g, '{') .replace(/%5D/g, ']') .replace(/%7D/g, '}') + .replace(/%2B/g, '+') .replace(/%25/g, '%') .replace(/'/g, '%27'); }, diff --git a/codegens/ocaml-cohttp/test/unit/convert.test.js b/codegens/ocaml-cohttp/test/unit/convert.test.js index 0d80296c8..cd242f032 100644 --- a/codegens/ocaml-cohttp/test/unit/convert.test.js +++ b/codegens/ocaml-cohttp/test/unit/convert.test.js @@ -3,6 +3,7 @@ var expect = require('chai').expect, convert = require('../../index').convert, getOptions = require('../../index').getOptions, sanitize = require('../../lib/util').sanitize, + getUrlStringfromUrlObject = require('../../lib/util').getUrlStringfromUrlObject, mainCollection = require('./fixtures/testcollection/collection.json'); describe('Ocaml unit tests', function () { @@ -245,5 +246,15 @@ describe('Ocaml unit tests', function () { expect(sanitize(123, 'raw', false)).to.equal(''); expect(sanitize('inputString', 123, true)).to.equal('inputString'); }); + + it('should not encode unresolved query params and ' + + 'encode every other query param, both present together', function () { + let rawUrl = 'https://postman-echo.com/get?key1={{value}}&key2=\'a b+c\'', + urlObject = new sdk.Url(rawUrl), + outputUrlString = getUrlStringfromUrlObject(urlObject); + expect(outputUrlString).to.not.include('key1=%7B%7Bvalue%7B%7B'); + expect(outputUrlString).to.not.include('key2=\'a b+c\''); + expect(outputUrlString).to.equal('https://postman-echo.com/get?key1={{value}}&key2=%27a%20b+c%27'); + }); }); }); diff --git a/codegens/ocaml-cohttp/test/unit/fixtures/testcollection/collection.json b/codegens/ocaml-cohttp/test/unit/fixtures/testcollection/collection.json index a298e0cb3..74ab9710f 100644 --- a/codegens/ocaml-cohttp/test/unit/fixtures/testcollection/collection.json +++ b/codegens/ocaml-cohttp/test/unit/fixtures/testcollection/collection.json @@ -52,11 +52,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -103,11 +103,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request?test=123&anotherone=232", + "raw": "https://postman-echo.com/request?test=123&anotherone=232", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -143,11 +143,11 @@ } ], "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -199,11 +199,11 @@ "raw": "\"'Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, \"id\" \"se\\\"mper\" sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.'\"" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -395,11 +395,11 @@ ] }, "url": { - "raw": "https://mockbin.org/request?hardik=\"me\"", + "raw": "https://postman-echo.com/request?hardik=\"me\"", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -456,11 +456,11 @@ "raw": "{\n \"json\": \"Test-Test\"\n}" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -640,11 +640,11 @@ "raw": "var val = 6;\nconsole.log(val);" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -695,11 +695,11 @@ "raw": "\n Test Test\n" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -750,11 +750,11 @@ "raw": "\n Test Test\n" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -779,14 +779,13 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request/:action", + "raw": "https://postman-echo.com/:action", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ - "request", ":action" ], "variable": [ @@ -838,11 +837,11 @@ "raw": "Etiam mi lacus, cursus vitae felis et, blandit pellentesque neque. Vestibulum eget nisi a tortor commodo dignissim.\nQuisque ipsum ligula, faucibus a felis a, commodo elementum nisl. Mauris vulputate sapien et tincidunt viverra. Donec vitae velit nec metus." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -891,11 +890,11 @@ "raw": "Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -960,11 +959,11 @@ ] }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1015,11 +1014,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1045,11 +1044,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1073,11 +1072,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1101,11 +1100,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1129,11 +1128,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1152,11 +1151,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1177,11 +1176,11 @@ ], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1205,11 +1204,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1228,13 +1227,11 @@ "raw": "" }, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1249,13 +1246,11 @@ "raw": "" }, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1343,7 +1338,7 @@ } ], "cookie": [], - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] }, @@ -1357,11 +1352,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1379,11 +1374,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1495,14 +1490,14 @@ { "expires": "Invalid Date", "httpOnly": true, - "domain": "mockbin.org", + "domain": "postman-echo.com", "path": "/", "secure": false, "value": "dfb94a3e1f3f8a9956138e4896847caf21521013330", "key": "__cfduid" } ], - "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://mockbin.org/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"mockbin.org\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" + "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://postman-echo.com/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" } ] } diff --git a/codegens/php-curl/lib/util/sanitize.js b/codegens/php-curl/lib/util/sanitize.js index 6755abf3d..fab55ebee 100644 --- a/codegens/php-curl/lib/util/sanitize.js +++ b/codegens/php-curl/lib/util/sanitize.js @@ -174,6 +174,7 @@ const self = module.exports = { .replace(/%7B/g, '{') .replace(/%5D/g, ']') .replace(/%7D/g, '}') + .replace(/%2B/g, '+') .replace(/%25/g, '%') .replace(/'/g, '%27'); }, diff --git a/codegens/php-curl/test/unit/converter.test.js b/codegens/php-curl/test/unit/converter.test.js index 068b425fa..cf07d0f03 100644 --- a/codegens/php-curl/test/unit/converter.test.js +++ b/codegens/php-curl/test/unit/converter.test.js @@ -1,6 +1,7 @@ var expect = require('chai').expect, sdk = require('postman-collection'), - convert = require('../../lib/index').convert; + convert = require('../../lib/index').convert, + getUrlStringfromUrlObject = require('../../lib/util/sanitize').getUrlStringfromUrlObject; describe('php-curl converter', function () { it('should throw an error when callback is not function', function () { @@ -85,4 +86,13 @@ describe('php-curl converter', function () { }); }); + it('should not encode unresolved query params and ' + + 'encode every other query param, both present together', function () { + let rawUrl = 'https://postman-echo.com/get?key1={{value}}&key2=\'a b+c\'', + urlObject = new sdk.Url(rawUrl), + outputUrlString = getUrlStringfromUrlObject(urlObject); + expect(outputUrlString).to.not.include('key1=%7B%7Bvalue%7B%7B'); + expect(outputUrlString).to.not.include('key2=\'a b+c\''); + expect(outputUrlString).to.equal('https://postman-echo.com/get?key1={{value}}&key2=%27a%20b+c%27'); + }); }); diff --git a/codegens/php-curl/test/unit/fixtures/sample_collection.json b/codegens/php-curl/test/unit/fixtures/sample_collection.json index d8a244a28..e6f6d6554 100644 --- a/codegens/php-curl/test/unit/fixtures/sample_collection.json +++ b/codegens/php-curl/test/unit/fixtures/sample_collection.json @@ -1142,11 +1142,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1171,11 +1171,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1200,11 +1200,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1221,11 +1221,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1250,11 +1250,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1279,11 +1279,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1300,13 +1300,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1320,13 +1318,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1340,13 +1336,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, diff --git a/codegens/php-guzzle/test/unit/fixtures/sample_collection.json b/codegens/php-guzzle/test/unit/fixtures/sample_collection.json index cb4623e0a..e572e271e 100644 --- a/codegens/php-guzzle/test/unit/fixtures/sample_collection.json +++ b/codegens/php-guzzle/test/unit/fixtures/sample_collection.json @@ -1142,11 +1142,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1171,11 +1171,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1200,11 +1200,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1221,11 +1221,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1250,11 +1250,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1279,11 +1279,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1300,13 +1300,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1320,13 +1318,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1340,13 +1336,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, diff --git a/codegens/php-pecl-http/test/unit/converter.test.js b/codegens/php-pecl-http/test/unit/converter.test.js index 4cdd55e26..007408d70 100644 --- a/codegens/php-pecl-http/test/unit/converter.test.js +++ b/codegens/php-pecl-http/test/unit/converter.test.js @@ -505,11 +505,11 @@ describe('Request Snippet', function () { 'raw': {} }, 'url': { - 'raw': 'https://mockbin.org/request', + 'raw': 'https://postman-echo.com/request', 'protocol': 'https', 'host': [ - 'mockbin', - 'org' + 'postman-echo', + 'com' ], 'path': [ 'request' @@ -526,11 +526,11 @@ describe('Request Snippet', function () { 'header': [], 'body': {}, 'url': { - 'raw': 'https://mockbin.org/request', + 'raw': 'https://postman-echo.com/request', 'protocol': 'https', 'host': [ - 'mockbin', - 'org' + 'postman-echo', + 'com' ], 'path': [ 'request' @@ -549,11 +549,11 @@ describe('Request Snippet', function () { 'mode': 'lorem' }, 'url': { - 'raw': 'https://mockbin.org/request', + 'raw': 'https://postman-echo.com/request', 'protocol': 'https', 'host': [ - 'mockbin', - 'org' + 'postman-echo', + 'com' ], 'path': [ 'request' @@ -569,11 +569,11 @@ describe('Request Snippet', function () { 'method': 'POST', 'header': [], 'url': { - 'raw': 'https://mockbin.org/request', + 'raw': 'https://postman-echo.com/request', 'protocol': 'https', 'host': [ - 'mockbin', - 'org' + 'postman-echo', + 'com' ], 'path': [ 'request' diff --git a/codegens/php-pecl-http/test/unit/fixtures/sample_collection.json b/codegens/php-pecl-http/test/unit/fixtures/sample_collection.json index 33cd4419c..5b2e05c48 100644 --- a/codegens/php-pecl-http/test/unit/fixtures/sample_collection.json +++ b/codegens/php-pecl-http/test/unit/fixtures/sample_collection.json @@ -1142,11 +1142,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1171,11 +1171,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1200,11 +1200,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1221,11 +1221,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1250,11 +1250,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1279,11 +1279,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1300,13 +1300,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1320,13 +1318,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1340,13 +1336,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, diff --git a/codegens/powershell-restmethod/lib/index.js b/codegens/powershell-restmethod/lib/index.js index f9bedfc3f..6d253ac08 100644 --- a/codegens/powershell-restmethod/lib/index.js +++ b/codegens/powershell-restmethod/lib/index.js @@ -1,5 +1,6 @@ var _ = require('./lodash'), sanitize = require('./util').sanitize, + sanitizeSingleQuotes = require('./util').sanitizeSingleQuotes, sanitizeOptions = require('./util').sanitizeOptions, addFormParam = require('./util').addFormParam, path = require('path'); @@ -289,12 +290,12 @@ function convert (request, options, callback) { } if (_.includes(VALID_METHODS, request.method)) { - codeSnippet += `$response = Invoke-RestMethod '${request.url.toString().replace(/'/g, '\'\'')}' -Method '` + + codeSnippet += `$response = Invoke-RestMethod '${sanitizeSingleQuotes(request.url.toString())}' -Method '` + `${request.method}' -Headers $headers`; } else { - codeSnippet += `$response = Invoke-RestMethod '${request.url.toString()}' -CustomMethod ` + - `'${request.method}' -Headers $headers`; + codeSnippet += `$response = Invoke-RestMethod '${sanitizeSingleQuotes(request.url.toString())}' -CustomMethod ` + + `'${sanitizeSingleQuotes(request.method)}' -Headers $headers`; } if (bodySnippet !== '') { codeSnippet += ' -Body $body'; diff --git a/codegens/powershell-restmethod/lib/util.js b/codegens/powershell-restmethod/lib/util.js index 97e2bec09..af3ce9d45 100644 --- a/codegens/powershell-restmethod/lib/util.js +++ b/codegens/powershell-restmethod/lib/util.js @@ -24,6 +24,22 @@ function sanitize (inputString, trim, shouldEscapeNewLine = true) { return trim ? inputString.trim() : inputString; } +/** + * + * @param {String} inputString - input string + * @returns {String} - sanitized string + */ +function sanitizeSingleQuotes (inputString) { + if (typeof inputString !== 'string') { + return ''; + } + inputString = inputString + .replace(/'/g, '\'\''); + + return inputString; + +} + /** * sanitizes input options * @@ -126,6 +142,7 @@ function addFormParam (array, key, type, val, disabled, contentType) { module.exports = { sanitize: sanitize, + sanitizeSingleQuotes: sanitizeSingleQuotes, sanitizeOptions: sanitizeOptions, addFormParam: addFormParam }; diff --git a/codegens/powershell-restmethod/test/unit/convert.test.js b/codegens/powershell-restmethod/test/unit/convert.test.js index 8efd8e55e..ce8cf8907 100644 --- a/codegens/powershell-restmethod/test/unit/convert.test.js +++ b/codegens/powershell-restmethod/test/unit/convert.test.js @@ -156,11 +156,11 @@ describe('Powershell-restmethod converter', function () { 'raw': 'Hello world' }, 'url': { - 'raw': 'https://mockbin.org/request', + 'raw': 'https://postman-echo.com/request', 'protocol': 'https', 'host': [ - 'mockbin', - 'org' + 'postman-echo', + 'com' ], 'path': [ 'request' @@ -188,7 +188,7 @@ describe('Powershell-restmethod converter', function () { expect(lines[3]).to.eql('$body = @"'); expect(lines[4]).to.eql('Hello world'); expect(lines[5]).to.eql('"@'); - expect(lines[7]).to.eql('$response = Invoke-RestMethod \'https://mockbin.org/request\' -Method \'POST\' -Headers $headers -Body $body -TimeoutSec 10'); // eslint-disable-line max-len + expect(lines[7]).to.eql('$response = Invoke-RestMethod \'https://postman-echo.com/request\' -Method \'POST\' -Headers $headers -Body $body -TimeoutSec 10'); // eslint-disable-line max-len expect(lines[8]).to.eql('$response | ConvertTo-Json'); }); }); @@ -498,6 +498,45 @@ describe('Powershell-restmethod converter', function () { }); }); + it('should generate valid snippet when single quotes in custom request method', function () { + var request = new sdk.Request({ + // eslint-disable-next-line quotes + 'method': "TEST';DIR;#'", + 'header': [], + 'url': { + 'raw': 'https://postman-echo.com/get?query1=b\'b&query2=c"c', + 'protocol': 'https', + 'host': [ + 'postman-echo', + 'com' + ], + 'path': [ + 'get' + ], + 'query': [ + { + 'key': 'query1', + 'value': "b'b" // eslint-disable-line quotes + }, + { + 'key': 'query2', + 'value': 'c"c' + } + ] + } + }); + convert(request, {}, function (error, snippet) { + if (error) { + expect.fail(null, null, error); + } + expect(snippet).to.be.a('string'); + // An extra single quote is placed before a single quote to escape a single quote inside a single quoted string + // eslint-disable-next-line quotes + expect(snippet).to.include("-CustomMethod 'TEST'';DIR;#'''"); + }); + }); + + it('should generate snippet for form data params with no type key present', function () { var request = new sdk.Request({ method: 'POST', diff --git a/codegens/powershell-restmethod/test/unit/fixtures/testcollection/collection.json b/codegens/powershell-restmethod/test/unit/fixtures/testcollection/collection.json index 264965912..5afead2ea 100644 --- a/codegens/powershell-restmethod/test/unit/fixtures/testcollection/collection.json +++ b/codegens/powershell-restmethod/test/unit/fixtures/testcollection/collection.json @@ -49,11 +49,11 @@ ], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -123,11 +123,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request?test=123&anotherone=232", + "raw": "https://postman-echo.com/request?test=123&anotherone=232", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -197,11 +197,11 @@ "raw": "\"'Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, \"id\" \"se\\\"mper\" sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.'\"" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -368,11 +368,11 @@ ] }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -430,11 +430,11 @@ "raw": "{\n \"json\": \"Test-Test\"\n}" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -615,11 +615,11 @@ "raw": "var val = 6;\nconsole.log(val);" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -670,11 +670,11 @@ "raw": "\n Test Test\n" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -725,11 +725,11 @@ "raw": "\n Test Test\n" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -754,14 +754,13 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request/:action", + "raw": "https://postman-echo.com/:action", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ - "request", ":action" ], "variable": [ @@ -814,11 +813,11 @@ "raw": "Etiam mi lacus, cursus vitae felis et, blandit pellentesque neque. Vestibulum eget nisi a tortor commodo dignissim.\nQuisque ipsum ligula, faucibus a felis a, commodo elementum nisl. Mauris vulputate sapien et tincidunt viverra. Donec vitae velit nec metus." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -867,11 +866,11 @@ "raw": "Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -945,11 +944,11 @@ ] }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1024,11 +1023,11 @@ ], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1053,11 +1052,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1082,11 +1081,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1111,11 +1110,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1132,11 +1131,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1161,11 +1160,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1190,13 +1189,11 @@ "raw": "" }, "url": { - "raw": "https://16c2790a-a0a2-4a4b-88c6-46f6459e715f.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "16c2790a-a0a2-4a4b-88c6-46f6459e715f", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1210,11 +1207,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1231,11 +1228,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1252,11 +1249,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1368,14 +1365,14 @@ { "expires": "Thu Mar 14 2019 13:12:10 GMT+0530 (IST)", "httpOnly": true, - "domain": "mockbin.org", + "domain": "postman-echo.com", "path": "/", "secure": false, "value": "dfb94a3e1f3f8a9956138e4896847caf21521013330", "key": "__cfduid" } ], - "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://mockbin.org/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"mockbin.org\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" + "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://postman-echo.com/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" } ] } diff --git a/codegens/python-http.client/test/unit/fixtures/sample_collection.json b/codegens/python-http.client/test/unit/fixtures/sample_collection.json index 72025ab3d..234fd60a7 100644 --- a/codegens/python-http.client/test/unit/fixtures/sample_collection.json +++ b/codegens/python-http.client/test/unit/fixtures/sample_collection.json @@ -1428,11 +1428,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1449,13 +1449,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1469,13 +1467,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1489,13 +1485,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, diff --git a/codegens/python-requests/test/unit/fixtures/sample_collection.json b/codegens/python-requests/test/unit/fixtures/sample_collection.json index 4d2aa2698..1968858e8 100644 --- a/codegens/python-requests/test/unit/fixtures/sample_collection.json +++ b/codegens/python-requests/test/unit/fixtures/sample_collection.json @@ -1421,13 +1421,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1441,13 +1439,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1461,13 +1457,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, diff --git a/codegens/r-httr/test/unit/fixtures/sample_collection.json b/codegens/r-httr/test/unit/fixtures/sample_collection.json index c8347f91f..c003e6bf1 100644 --- a/codegens/r-httr/test/unit/fixtures/sample_collection.json +++ b/codegens/r-httr/test/unit/fixtures/sample_collection.json @@ -1144,11 +1144,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1173,11 +1173,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1202,11 +1202,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1223,11 +1223,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1252,11 +1252,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1281,11 +1281,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1302,13 +1302,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1322,13 +1320,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1342,13 +1338,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, diff --git a/codegens/r-rcurl/test/unit/fixtures/sample_collection.json b/codegens/r-rcurl/test/unit/fixtures/sample_collection.json index 817dd0eaf..3977935be 100644 --- a/codegens/r-rcurl/test/unit/fixtures/sample_collection.json +++ b/codegens/r-rcurl/test/unit/fixtures/sample_collection.json @@ -1142,11 +1142,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1171,11 +1171,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1200,11 +1200,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1221,11 +1221,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1250,11 +1250,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1279,11 +1279,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1300,13 +1300,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1320,13 +1318,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -1340,13 +1336,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1718,11 +1712,11 @@ "method": "GET", "header": [], "url": { - "raw": "https://mockbin.org/redirect/302/1/?to=https://postman-echo.com/get", + "raw": "https://postman-echo.com/redirect/302/1/?to=https://postman-echo.com/get", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "redirect", diff --git a/codegens/ruby/lib/util/parseBody.js b/codegens/ruby/lib/util/parseBody.js index eafd8b9db..31ebd2f1f 100644 --- a/codegens/ruby/lib/util/parseBody.js +++ b/codegens/ruby/lib/util/parseBody.js @@ -43,8 +43,8 @@ module.exports = function (request, trimRequestBody, contentType, indentCount) { if (contentType && (contentType === 'application/json' || contentType.match(/\+json$/))) { try { let jsonBody = JSON.parse(request.body[request.body.mode]); - jsonBody = JSON.stringify(jsonBody, replacer, indentCount) - .replace(new RegExp(`"${nullToken}"`, 'g'), 'nil'); + jsonBody = sanitize(JSON.stringify(jsonBody, replacer, indentCount)); + jsonBody = jsonBody.replace(new RegExp(`"${nullToken}"`, 'g'), 'nil'); return `request.body = JSON.dump(${jsonBody})\n`; } catch (error) { diff --git a/codegens/ruby/lib/util/sanitize.js b/codegens/ruby/lib/util/sanitize.js index 1cc893054..9efe53fc7 100644 --- a/codegens/ruby/lib/util/sanitize.js +++ b/codegens/ruby/lib/util/sanitize.js @@ -13,6 +13,11 @@ module.exports = { return ''; } inputString = inputTrim && typeof inputTrim === 'boolean' ? inputString.trim() : inputString; + inputString = inputString + .replace(/`/g, '\\`') + .replace(/#/g, '\\#') + .replace(/\$/g, '\\$') + .replace(/!/g, '\\!'); if (escapeCharFor && typeof escapeCharFor === 'string') { switch (escapeCharFor) { case 'raw': diff --git a/codegens/ruby/test/unit/converter.test.js b/codegens/ruby/test/unit/converter.test.js index bad80c77e..2eae803ad 100644 --- a/codegens/ruby/test/unit/converter.test.js +++ b/codegens/ruby/test/unit/converter.test.js @@ -58,6 +58,39 @@ describe('Ruby converter', function () { }); }); + it('should escape special characters inside double quotes', function () { + var request = new sdk.Request({ + 'method': 'POST', + 'header': [ + 'Content-Type: application/json' + ], + 'body': { + 'mode': 'raw', + 'raw': '{\r\n "hi": "#{`curl https://postman-echo.com`}",\r\n "message": "This is a ruby Code"\r\n}', + 'options': { + 'raw': { + 'language': 'json' + } + } + }, + 'url': { + 'raw': 'https://google.com', + 'protocol': 'https', + 'host': [ + 'google', + 'com' + ] + } + }); + convert(request, {}, function (error, snippet) { + if (error) { + expect.fail(null, null, error); + } + expect(snippet).to.be.a('string'); + expect(snippet).to.include('\\#{\\`curl https://postman-echo.com\\`}'); + }); + }); + it('should generate snippets for no files in form data', function () { var request = new sdk.Request({ 'method': 'POST', diff --git a/codegens/ruby/test/unit/fixtures/sample_collection.json b/codegens/ruby/test/unit/fixtures/sample_collection.json index 2cf55a2f6..ddcb46d36 100644 --- a/codegens/ruby/test/unit/fixtures/sample_collection.json +++ b/codegens/ruby/test/unit/fixtures/sample_collection.json @@ -1152,11 +1152,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1181,11 +1181,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1210,11 +1210,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1236,11 +1236,11 @@ ], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1265,11 +1265,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1294,11 +1294,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1315,13 +1315,11 @@ "header": [], "body": {}, "url": { - "raw": "https://8b32a2c6-4296-4c28-b383-889571041e69.mock.pstmn.io/testpurge", + "raw": "https://postman-echo.com/testpurge", "protocol": "https", "host": [ - "8b32a2c6-4296-4c28-b383-889571041e69", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path":[ "testpurge" @@ -1338,13 +1336,11 @@ "header": [], "body": {}, "url": { - "raw": "https://8cf6f433-4274-41e1-a763-cf45262ecd57.mock.pstmn.io/testcopy", + "raw": "https://postman-echo.com/testcopy", "protocol": "https", "host": [ - "8cf6f433-4274-41e1-a763-cf45262ecd57", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ], "path":[ "testcopy" @@ -1361,13 +1357,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, diff --git a/codegens/shell-httpie/examples/test-collection.json b/codegens/shell-httpie/examples/test-collection.json index 5215ca523..71d5e28d0 100644 --- a/codegens/shell-httpie/examples/test-collection.json +++ b/codegens/shell-httpie/examples/test-collection.json @@ -1014,11 +1014,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1043,11 +1043,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1072,11 +1072,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1093,11 +1093,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1122,11 +1122,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1151,11 +1151,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1172,13 +1172,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": null @@ -1192,13 +1190,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1287,7 +1283,7 @@ ], "cookie": [], "responseTime": "375", - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] }, @@ -1298,11 +1294,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1319,11 +1315,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1435,14 +1431,14 @@ { "expires": "Thu Mar 14 2019 13:12:10 GMT+0530 (IST)", "httpOnly": true, - "domain": "mockbin.org", + "domain": "postman-echo.com", "path": "/", "secure": false, "value": "dfb94a3e1f3f8a9956138e4896847caf21521013330", "key": "__cfduid" } ], - "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://mockbin.org/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"mockbin.org\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" + "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://postman-echo.com/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" } ] } diff --git a/codegens/shell-wget/test/unit/fixtures/sample_collection.json b/codegens/shell-wget/test/unit/fixtures/sample_collection.json index f7021038a..a83c5b001 100644 --- a/codegens/shell-wget/test/unit/fixtures/sample_collection.json +++ b/codegens/shell-wget/test/unit/fixtures/sample_collection.json @@ -1105,11 +1105,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1134,11 +1134,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1163,11 +1163,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1184,11 +1184,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1213,11 +1213,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" diff --git a/codegens/swift/lib/util.js b/codegens/swift/lib/util.js index 4465a5d81..0a83261ab 100644 --- a/codegens/swift/lib/util.js +++ b/codegens/swift/lib/util.js @@ -115,6 +115,7 @@ function encodeParam (param) { .replace(/%7B/g, '{') .replace(/%5D/g, ']') .replace(/%7D/g, '}') + .replace(/%2B/g, '+') .replace(/%25/g, '%') .replace(/'/g, '%27'); } diff --git a/codegens/swift/test/unit/convert.test.js b/codegens/swift/test/unit/convert.test.js index 5be4966fe..82650b1b4 100644 --- a/codegens/swift/test/unit/convert.test.js +++ b/codegens/swift/test/unit/convert.test.js @@ -324,12 +324,12 @@ describe('Swift Converter', function () { it('should not encode unresolved query params and ' + 'encode every other query param, both present together', function () { - rawUrl = 'https://postman-echo.com/get?key1={{value}}&key2=\'a b c\''; + rawUrl = 'https://postman-echo.com/get?key1={{value}}&key2=\'a b+c\''; urlObject = new sdk.Url(rawUrl); outputUrlString = getUrlStringfromUrlObject(urlObject); expect(outputUrlString).to.not.include('key1=%7B%7Bvalue%7B%7B'); - expect(outputUrlString).to.not.include('key2=\'a b c\''); - expect(outputUrlString).to.equal('https://postman-echo.com/get?key1={{value}}&key2=%27a%20b%20c%27'); + expect(outputUrlString).to.not.include('key2=\'a b+c\''); + expect(outputUrlString).to.equal('https://postman-echo.com/get?key1={{value}}&key2=%27a%20b+c%27'); }); it('should not encode query params that are already encoded', function () { diff --git a/codegens/swift/test/unit/fixtures/testcollection/collection.json b/codegens/swift/test/unit/fixtures/testcollection/collection.json index dff2cd81c..14489a9ae 100644 --- a/codegens/swift/test/unit/fixtures/testcollection/collection.json +++ b/codegens/swift/test/unit/fixtures/testcollection/collection.json @@ -50,11 +50,11 @@ "body": { }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -101,11 +101,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request?test=123&anotherone=232", + "raw": "https://postman-echo.com/request?test=123&anotherone=232", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -172,11 +172,11 @@ "raw": "\"'Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, \"id\" \"se\\\"mper\" sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat.'\"" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -337,11 +337,11 @@ ] }, "url": { - "raw": "https://mockbin.org/request?hardik=\"me\"", + "raw": "https://postman-echo.com/request?hardik=\"me\"", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -398,11 +398,11 @@ "raw": "{\n \"json\": \"Test-Test\"\n}" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -582,11 +582,11 @@ "raw": "var val = 6;\nconsole.log(val);" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -637,11 +637,11 @@ "raw": "\n Test Test\n" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -692,11 +692,11 @@ "raw": "\n Test Test\n" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -721,14 +721,13 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request/:action", + "raw": "https://postman-echo.com/:action", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ - "request", ":action" ], "variable": [ @@ -780,11 +779,11 @@ "raw": "Etiam mi lacus, cursus vitae felis et, blandit pellentesque neque. Vestibulum eget nisi a tortor commodo dignissim.\nQuisque ipsum ligula, faucibus a felis a, commodo elementum nisl. Mauris vulputate sapien et tincidunt viverra. Donec vitae velit nec metus." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -833,11 +832,11 @@ "raw": "Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -902,11 +901,11 @@ ] }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -957,11 +956,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -987,11 +986,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1015,11 +1014,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1043,11 +1042,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1071,11 +1070,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1094,11 +1093,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1122,11 +1121,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1150,11 +1149,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1173,13 +1172,11 @@ "raw": "" }, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1194,13 +1191,11 @@ "raw": "" }, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, @@ -1288,7 +1283,7 @@ } ], "cookie": [], - "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io\"\n}" + "body": "{\n \"args\": {},\n \"data\": \"Curabitur auctor, elit nec pulvinar porttitor, ex augue condimentum enim, eget suscipit urna felis quis neque.\\nSuspendisse sit amet luctus massa, nec venenatis mi. Suspendisse tincidunt massa at nibh efficitur fringilla. Nam quis congue mi. Etiam volutpat.\",\n \"files\": {},\n \"form\": {},\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"content-length\": \"256\",\n \"accept\": \"*/*\",\n \"accept-encoding\": \"gzip, deflate\",\n \"content-type\": \"text/plain\",\n \"cookie\": \"sails.sid=s%3A1wOi4AdoZEbqBjGi6oSUC5Vlfje8wJvs.DHQfRLXfIBvZ%2Bv0KhLAThMDz%2FXvxh9gyxWYa0u1EZOU\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"x-forwarded-port\": \"443\",\n \"x-forwarded-proto\": \"https\"\n },\n \"json\": null,\n \"url\": \"https://postman-echo.com\"\n}" } ] }, @@ -1302,11 +1297,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1324,11 +1319,11 @@ "raw": "" }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -1440,14 +1435,14 @@ { "expires": "Invalid Date", "httpOnly": true, - "domain": "mockbin.org", + "domain": "postman-echo.com", "path": "/", "secure": false, "value": "dfb94a3e1f3f8a9956138e4896847caf21521013330", "key": "__cfduid" } ], - "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://mockbin.org/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"mockbin.org\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" + "body": "{\n \"startedDateTime\": \"2018-03-14T09:06:37.443Z\",\n \"clientIPAddress\": \"106.51.70.154\",\n \"method\": \"COPY\",\n \"url\": \"https://postman-echo.com/request\",\n \"httpVersion\": \"HTTP/1.1\",\n \"cookies\": {\n \"__cfduid\": \"dfb94a3e1f3f8a9956138e4896847caf21521013330\"\n },\n \"headers\": {\n \"host\": \"postman-echo.com\",\n \"connection\": \"close\",\n \"accept-encoding\": \"gzip\",\n \"x-forwarded-for\": \"106.51.70.154, 172.68.255.127\",\n \"cf-ray\": \"3fb595d5facaa302-HKG\",\n \"x-forwarded-proto\": \"http\",\n \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\",\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"8d5b9832-75df-432f-90a3-284dacef0478\",\n \"user-agent\": \"PostmanRuntime/7.1.1\",\n \"accept\": \"*/*\",\n \"cookie\": \"__cfduid=dfb94a3e1f3f8a9956138e4896847caf21521013330\",\n \"cf-connecting-ip\": \"106.51.70.154\",\n \"x-request-id\": \"0e41473d-5130-4a6e-968d-b2a16cda3364\",\n \"x-forwarded-port\": \"80\",\n \"via\": \"1.1 vegur\",\n \"connect-time\": \"2\",\n \"x-request-start\": \"1521018397437\",\n \"total-route-time\": \"0\",\n \"content-length\": \"0\"\n },\n \"queryString\": {},\n \"postData\": {\n \"mimeType\": \"application/octet-stream\",\n \"text\": \"\",\n \"params\": []\n },\n \"headersSize\": 637,\n \"bodySize\": 0\n}" } ] } diff --git a/package-lock.json b/package-lock.json index cda3db0e0..44cdc098c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "postman-code-generators", - "version": "1.9.0", + "version": "1.10.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 09792cc09..2a0726236 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postman-code-generators", - "version": "1.9.0", + "version": "1.10.0", "description": "Generates code snippets for a postman collection", "main": "index.js", "directories": { diff --git a/test/codegen/newman/fixtures/formdataFileCollection.json b/test/codegen/newman/fixtures/formdataFileCollection.json index 95ba28c1e..0b96e30e7 100644 --- a/test/codegen/newman/fixtures/formdataFileCollection.json +++ b/test/codegen/newman/fixtures/formdataFileCollection.json @@ -17,15 +17,15 @@ "key": "single file", "value": "", "type": "file", - "src": "/Users/luis.tejeda/Documents/Source/GitHub/postmanlabs/postman-code-generators/dummyFile1.txt" + "src": "/Users/amansingh/workspace/postman-code-generators/dummyFile1.txt" }, { "key": "multiple files", "value": "", "type": "file", "src": [ - "/Users/luis.tejeda/Documents/Source/GitHub/postmanlabs/postman-code-generators/dummyFile2.txt", - "/Users/luis.tejeda/Documents/Source/GitHub/postmanlabs/postman-code-generators/dummyFile3.txt" + "/Users/amansingh/workspace/postman-code-generators/dummyFile2.txt", + "/Users/amansingh/workspace/postman-code-generators/dummyFile3.txt" ] } ] @@ -55,7 +55,7 @@ "key": "binary file", "value": "", "type": "file", - "src": "/Users/luis.tejeda/Documents/Source/GitHub/postmanlabs/postman-code-generators/dummyBinaryFile" + "src": "/Users/amansingh/workspace/postman-code-generators/dummyBinaryFile" } ] }, diff --git a/test/codegen/newman/fixtures/unsupportedMethods.json b/test/codegen/newman/fixtures/unsupportedMethods.json index 2ac67616a..238ef1dec 100644 --- a/test/codegen/newman/fixtures/unsupportedMethods.json +++ b/test/codegen/newman/fixtures/unsupportedMethods.json @@ -21,11 +21,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -50,11 +50,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -79,11 +79,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -100,11 +100,11 @@ "header": [], "body": {}, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -129,11 +129,11 @@ "raw": "Duis posuere augue vel cursus pharetra. In luctus a ex nec pretium. Praesent neque quam, tincidunt nec leo eget, rutrum vehicula magna.\nMaecenas consequat elementum elit, id semper sem tristique et. Integer pulvinar enim quis consectetur interdum volutpat." }, "url": { - "raw": "https://mockbin.org/request", + "raw": "https://postman-echo.com/request", "protocol": "https", "host": [ - "mockbin", - "org" + "postman-echo", + "com" ], "path": [ "request" @@ -150,13 +150,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -170,13 +168,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] }, "description": "" @@ -190,13 +186,11 @@ "header": [], "body": {}, "url": { - "raw": "https://9c76407d-5b8d-4b22-99fb-8c47a85d9848.mock.pstmn.io", + "raw": "https://postman-echo.com", "protocol": "https", "host": [ - "9c76407d-5b8d-4b22-99fb-8c47a85d9848", - "mock", - "pstmn", - "io" + "postman-echo", + "com" ] } }, diff --git a/test/codegen/newman/newmanTestUtil.js b/test/codegen/newman/newmanTestUtil.js index 9fa53dc22..c017d5ec6 100644 --- a/test/codegen/newman/newmanTestUtil.js +++ b/test/codegen/newman/newmanTestUtil.js @@ -150,7 +150,7 @@ function runSnippet (testConfig, snippets, collectionName) { }); } } - expect(result[0]).deep.equal(result[1]); + expect(result[0].toString().trim()).deep.equal(result[1].toString().trim()); return done(null); }); });