From 180091aca0a72acac60b9470ee3606c3868f42bb Mon Sep 17 00:00:00 2001 From: Jemma Date: Mon, 24 Apr 2023 23:52:29 -0500 Subject: [PATCH] Added initial support for api testing via postman --- .postman/api | 4 + .../api_093b0c82-779f-419f-9aca-029910a07e65 | 20 + postman/collections/Communities.json | 479 ++++++++++++++++++ postman/collections/People.json | 167 ++++++ 4 files changed, 670 insertions(+) create mode 100644 .postman/api create mode 100644 .postman/api_093b0c82-779f-419f-9aca-029910a07e65 create mode 100644 postman/collections/Communities.json create mode 100644 postman/collections/People.json diff --git a/.postman/api b/.postman/api new file mode 100644 index 0000000..cd3d9e2 --- /dev/null +++ b/.postman/api @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY +apis[] = {"apiId":"093b0c82-779f-419f-9aca-029910a07e65"} +configVersion = 1.0.0 +type = api diff --git a/.postman/api_093b0c82-779f-419f-9aca-029910a07e65 b/.postman/api_093b0c82-779f-419f-9aca-029910a07e65 new file mode 100644 index 0000000..5ae6271 --- /dev/null +++ b/.postman/api_093b0c82-779f-419f-9aca-029910a07e65 @@ -0,0 +1,20 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY +configVersion = 1.0.0 +type = apiEntityData + +[config] +id = 093b0c82-779f-419f-9aca-029910a07e65 + +[config.relations] + +[config.relations.collections] +rootDirectory = postman/collections +files[] = {"id":"19511066-cb605935-6073-42c5-afa9-96d9a19c70a3","path":"Communities.json","metaData":{}} +files[] = {"id":"19511066-2bb4ba1f-8e09-44b9-9ad1-5f59455c0ba7","path":"People.json","metaData":{}} + +[config.relations.collections.metaData] + +[config.relations.apiDefinition] +rootDirectory = postman/schemas + +[config.relations.apiDefinition.metaData] diff --git a/postman/collections/Communities.json b/postman/collections/Communities.json new file mode 100644 index 0000000..5114a0d --- /dev/null +++ b/postman/collections/Communities.json @@ -0,0 +1,479 @@ +{ + "info": { + "_postman_id": "cb605935-6073-42c5-afa9-96d9a19c70a3", + "name": "Communities", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_uid": "19511066-cb605935-6073-42c5-afa9-96d9a19c70a3" + }, + "item": [ + { + "name": "GET /v1/communities", + "item": [ + { + "name": "Sub-Community", + "id": "0c9cf1fc-61a0-4deb-b910-e54701e39ae5", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_MarioVsDK}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/communities", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "communities" + ] + } + }, + "response": [] + }, + { + "name": "Single Community", + "id": "77083b95-581f-40cf-8d83-ade183923ba0", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_Splatoon}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/communities", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "communities" + ], + "query": [ + { + "key": "", + "value": "", + "type": "text", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Invalid Title ID", + "id": "9bb6971f-f95a-4a53-960a-e9383854c2cc", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_Bad_TID}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/communities", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "communities" + ], + "query": [ + { + "key": "", + "value": "", + "type": "text", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Invalid ParamPack Format", + "id": "7e5058a3-5faa-4016-a86d-e288a1e3355f", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_Bad Format}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/communities", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "communities" + ], + "query": [ + { + "key": "", + "value": "", + "type": "text", + "disabled": true + } + ] + } + }, + "response": [] + } + ], + "id": "9a31cc53-451e-4fb2-aace-ee3db9641243" + }, + { + "name": "GET /v1/communities/:id/posts", + "item": [ + { + "name": "No Params", + "id": "3ea312f0-d205-4c25-b11a-218d0b28854d", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_Splatoon}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/communities/0/posts", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "communities", + "0", + "posts" + ] + } + }, + "response": [] + }, + { + "name": "Limit", + "id": "84d199be-78f5-4d65-955b-08f47b7ed1e7", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_Splatoon}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/communities/0/posts?limit=2", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "communities", + "0", + "posts" + ], + "query": [ + { + "key": "limit", + "value": "2" + } + ] + } + }, + "response": [] + }, + { + "name": "Search Key", + "id": "3754a070-9dbc-4b35-b0b8-4480d5d5aa38", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_ACPlaza}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/communities/0/posts?search_key=sza", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "communities", + "0", + "posts" + ], + "query": [ + { + "key": "search_key", + "value": "sza" + } + ] + } + }, + "response": [] + }, + { + "name": "Type memo", + "id": "71362a5d-d976-402d-80d5-80e593d6ac0f", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_ACPlaza}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/communities/0/posts?type=memo", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "communities", + "0", + "posts" + ], + "query": [ + { + "key": "type", + "value": "memo" + } + ] + } + }, + "response": [] + }, + { + "name": "By Followings", + "id": "70355c69-a29f-4fbc-bdb4-495b579b21f2", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_ACPlaza}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/communities/0/posts?by=followings", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "communities", + "0", + "posts" + ], + "query": [ + { + "key": "by", + "value": "followings" + } + ] + } + }, + "response": [] + }, + { + "name": "By Self", + "id": "823b727d-f295-4cb3-9dbc-12c55a716ea1", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_Splatoon}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/communities/0/posts?by=self", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "communities", + "0", + "posts" + ], + "query": [ + { + "key": "by", + "value": "self" + } + ] + } + }, + "response": [] + }, + { + "name": "Allow Spoiler", + "id": "875cd973-3de9-429c-b61b-ba80320ffd22", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_Splatoon}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/communities/0/posts?allow_spoiler=1", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "communities", + "0", + "posts" + ], + "query": [ + { + "key": "allow_spoiler", + "value": "1" + } + ] + } + }, + "response": [] + } + ], + "id": "9078f117-f05e-459b-ac03-59be51f48ecf" + } + ], + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{ServiceToken}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Nintendo-ServiceToken", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "id": "ab6f4437-0090-4f7e-a72e-36c1db11a5a7", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "095ce2df-1f5a-4fcf-b4d4-c3b7616d3baa", + "type": "text/javascript", + "exec": [ + "const headerSchema = {", + " \"type\": \"object\",", + " \"properties\": {", + " \"result\": {", + " \"type\": \"object\",", + " \"properties\": {", + " \"has_error\": {", + " \"type\": \"string\",", + " \"maxLength\": 1", + " },", + " \"version\": {", + " \"type\": \"string\",", + " \"maxLength\": 1", + " },", + " \"expire\": {", + " \"type\": \"string\",", + " \"pattern\": \"^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,3})?\"", + " },", + " \"request_name\": {", + " \"type\": \"string\"", + " }", + " },", + " \"required\": [", + " \"has_error\",", + " \"version\",", + " \"request_name\"", + " ]", + " },", + "", + " },", + " \"required\": [", + " \"result\"", + " ]", + "};", + "", + "pm.test(\"Valid XML Response Header\", function () {", + " var json = xml2Json(pm.response.text());", + " pm.expect(json).to.have.jsonSchema(headerSchema);", + "})" + ] + } + } + ] +} \ No newline at end of file diff --git a/postman/collections/People.json b/postman/collections/People.json new file mode 100644 index 0000000..8fce0e8 --- /dev/null +++ b/postman/collections/People.json @@ -0,0 +1,167 @@ +{ + "info": { + "_postman_id": "2bb4ba1f-8e09-44b9-9ad1-5f59455c0ba7", + "name": "People", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_uid": "19511066-2bb4ba1f-8e09-44b9-9ad1-5f59455c0ba7" + }, + "item": [ + { + "name": "GET /v1/people", + "item": [ + { + "name": "Friends", + "id": "688f1727-636a-4a41-ba96-a9f52c3fe2b9", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_Splatoon}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/people?relation=friend&distinct_pid=1", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "people" + ], + "query": [ + { + "key": "relation", + "value": "friend" + }, + { + "key": "distinct_pid", + "value": "1" + } + ] + } + }, + "response": [] + }, + { + "name": "Following", + "id": "00b11bd6-25f1-4c16-ac6f-d8f17895ca1c", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "X-Nintendo-ParamPack", + "value": "{{PP_Splatoon}}", + "type": "text" + } + ], + "url": { + "raw": "{{DOMAIN}}/v1/people?relation=following&distinct_pid=1", + "host": [ + "{{DOMAIN}}" + ], + "path": [ + "v1", + "people" + ], + "query": [ + { + "key": "relation", + "value": "following" + }, + { + "key": "distinct_pid", + "value": "1" + } + ] + } + }, + "response": [] + } + ], + "id": "826dbc90-90a0-483c-a94f-5d93f48a1804" + } + ], + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{ServiceToken}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Nintendo-ServiceToken", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "id": "86097a74-4b68-4b97-b176-45bcbedd2abf", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "540f44d8-e877-4739-ad86-0e471f183a27", + "type": "text/javascript", + "exec": [ + "const headerSchema = {", + " \"type\": \"object\",", + " \"properties\": {", + " \"result\": {", + " \"type\": \"object\",", + " \"properties\": {", + " \"has_error\": {", + " \"type\": \"string\",", + " \"maxLength\": 1", + " },", + " \"version\": {", + " \"type\": \"string\",", + " \"maxLength\": 1", + " },", + " \"expire\": {", + " \"type\": \"string\",", + " \"pattern\": \"^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,3})?\"", + " },", + " \"request_name\": {", + " \"type\": \"string\"", + " }", + " },", + " \"required\": [", + " \"has_error\",", + " \"version\",", + " \"request_name\"", + " ]", + " },", + "", + " },", + " \"required\": [", + " \"result\"", + " ]", + "};", + "", + "pm.test(\"Valid XML Response Header\", function () {", + " var json = xml2Json(pm.response.text());", + " pm.expect(json).to.have.jsonSchema(headerSchema);", + "})" + ] + } + } + ] +} \ No newline at end of file