Skip to content

Sync Swagger with code and 2 enhancements #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
251 changes: 238 additions & 13 deletions docs/Submission API.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "9776607d-8485-4e67-bd2a-55e0b5100580",
"_postman_id": "567b1b26-0edf-4f9f-9f69-ed0b35f8422c",
"name": "Submission API",
"description": "Topcoder Submission API Postman Collection",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
Expand Down Expand Up @@ -410,6 +410,58 @@
},
"response": []
},
{
"name": "GET Review types from ES with sortBy",
"event": [
{
"listen": "test",
"script": {
"id": "290c7b35-fc15-468e-81a8-bd2a4eefcd27",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{ADMIN_TOKEN}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{URL}}/reviewTypes?sortBy=created&orderBy=desc",
"host": [
"{{URL}}"
],
"path": [
"reviewTypes"
],
"query": [
{
"key": "sortBy",
"value": "created"
},
{
"key": "orderBy",
"value": "desc"
}
]
}
},
"response": []
},
{
"name": "GET Review types from ES with invalid filters",
"event": [
Expand Down Expand Up @@ -749,13 +801,13 @@
"listen": "test",
"script": {
"id": "b0a4b893-f851-47bb-8b41-5dc60ba76fa0",
"type": "text/javascript",
"exec": [
"if( responseCode.code === 200) {",
" const response = JSON.parse(responseBody);",
" pm.environment.set(\"reviewID\", response.id);",
"}"
]
],
"type": "text/javascript"
}
}
],
Expand All @@ -773,7 +825,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\"score\": 92.5,\n\t\"scoreCardId\": \"d46a4180-65aa-42ec-a945-5fd21d3d26f8\",\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"typeId\": \"c56a4180-65aa-42ec-a945-5fd21dec0503\",\n\t\"reviewerId\": \"c56a4180-65aa-42ec-a945-5fd21d3d26f8\"\n}"
"raw": "{\n\t\"score\": 92.5,\n\t\"scoreCardId\": 123456789,\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"typeId\": \"c56a4180-65aa-42ec-a945-5fd21dec0503\",\n\t\"reviewerId\": \"c56a4180-65aa-42ec-a945-5fd21d3d26f8\"\n}"
},
"url": {
"raw": "{{URL}}/reviews",
Expand Down Expand Up @@ -1101,6 +1153,54 @@
},
"response": []
},
{
"name": "GET Reviews from ES with sortBy",
"event": [
{
"listen": "test",
"script": {
"id": "290c7b35-fc15-468e-81a8-bd2a4eefcd27",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{ADMIN_TOKEN}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{URL}}/reviews?sortBy=score",
"host": [
"{{URL}}"
],
"path": [
"reviews"
],
"query": [
{
"key": "sortBy",
"value": "score"
}
]
}
},
"response": []
},
{
"name": "GET Reviews from ES with invalid filters",
"event": [
Expand Down Expand Up @@ -1284,10 +1384,10 @@
"listen": "test",
"script": {
"id": "f13eec0d-52e8-4650-b1b0-2db09992067b",
"type": "text/javascript",
"exec": [
""
]
],
"type": "text/javascript"
}
}
],
Expand All @@ -1305,7 +1405,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\"score\": 90.5,\n\t\"scoreCardId\": \"d46a4180-65aa-42ec-a555-5fd21d3d26f8\",\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"typeId\": \"c56a4180-65aa-42ec-a945-5fd21dec0503\",\n\t\"reviewerId\": \"c56a4180-65aa-42ec-a945-5fd21d3d26f8\"\n}"
"raw": "{\n\t\"score\": 90.5,\n\t\"scoreCardId\": 123456789,\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"typeId\": \"c56a4180-65aa-42ec-a945-5fd21dec0503\",\n\t\"reviewerId\": \"c56a4180-65aa-42ec-a945-5fd21d3d26f8\"\n}"
},
"url": {
"raw": "{{URL}}/reviews/{{reviewID}}",
Expand Down Expand Up @@ -1483,13 +1583,13 @@
"listen": "test",
"script": {
"id": "9a901742-45ac-4e6e-b3c5-3379ed7e74bf",
"type": "text/javascript",
"exec": [
"if( responseCode.code === 200) {",
" const response = JSON.parse(responseBody);",
" pm.environment.set(\"reviewSummationID\", response.id);",
"}"
]
],
"type": "text/javascript"
}
}
],
Expand All @@ -1507,7 +1607,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"aggregateScore\": 97.8,\n\t\"scoreCardId\": \"d46a4180-65aa-42ec-a945-5fd21d3d26f8\",\n\t\"isPassing\": true\n}"
"raw": "{\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"aggregateScore\": 97.8,\n\t\"scoreCardId\": 123456789,\n\t\"isPassing\": true\n}"
},
"url": {
"raw": "{{URL}}/reviewSummations",
Expand Down Expand Up @@ -1831,6 +1931,58 @@
},
"response": []
},
{
"name": "GET Review Summations from ES with sortBy",
"event": [
{
"listen": "test",
"script": {
"id": "290c7b35-fc15-468e-81a8-bd2a4eefcd27",
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{ADMIN_TOKEN}}"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{URL}}/reviewSummations?sortBy=aggregateScore&orderBy=DESC",
"host": [
"{{URL}}"
],
"path": [
"reviewSummations"
],
"query": [
{
"key": "sortBy",
"value": "aggregateScore"
},
{
"key": "orderBy",
"value": "DESC"
}
]
}
},
"response": []
},
{
"name": "GET Review Summations from ES with invalid filters",
"event": [
Expand Down Expand Up @@ -2014,10 +2166,10 @@
"listen": "test",
"script": {
"id": "f13eec0d-52e8-4650-b1b0-2db09992067b",
"type": "text/javascript",
"exec": [
""
]
],
"type": "text/javascript"
}
}
],
Expand All @@ -2035,7 +2187,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"aggregateScore\": 93.5,\n\t\"scoreCardId\": \"d46a4180-65aa-42ec-a945-5fd21d3d26f8\",\n\t\"isPassing\": true\n}"
"raw": "{\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"aggregateScore\": 93.5,\n\t\"scoreCardId\": 123456789,\n\t\"isPassing\": true\n}"
},
"url": {
"raw": "{{URL}}/reviewSummations/{{reviewSummationID}}",
Expand Down Expand Up @@ -2491,6 +2643,42 @@
},
"response": []
},
{
"name": "Get Submissions from ES with sortBy",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{USER_TOKEN}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{URL}}/submissions?sortBy=created&orderBy=asc",
"host": [
"{{URL}}"
],
"path": [
"submissions"
],
"query": [
{
"key": "sortBy",
"value": "created"
},
{
"key": "orderBy",
"value": "asc"
}
]
}
},
"response": []
},
{
"name": "Get Submissions from ES with invalid filters",
"request": {
Expand Down Expand Up @@ -2761,6 +2949,11 @@
"key": "typeId",
"value": "{{artifactID}}",
"type": "text"
},
{
"key": "filename",
"value": "{{filename}}",
"type": "text"
}
]
},
Expand Down Expand Up @@ -2927,6 +3120,38 @@
}
},
"response": []
},
{
"name": "Get Submissions from ES with filters Copy",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{USER_TOKEN}}"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{URL}}/submissions?type=ContestSubmission",
"host": [
"{{URL}}"
],
"path": [
"submissions"
],
"query": [
{
"key": "type",
"value": "ContestSubmission"
}
]
}
},
"response": []
}
],
"description": "End points related to Submission",
Expand Down
13 changes: 10 additions & 3 deletions docs/submission-api.postman_environment.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "eac995de-0f91-4dd2-a4c7-dab75cc3037e",
"id": "9f46d01c-0036-4350-aa00-c6860b4450de",
"name": "submission-api",
"values": [
{
Expand Down Expand Up @@ -36,9 +36,16 @@
"value": "c56a4180-65aa-42ec-a945-5fd21dec0503",
"description": "",
"enabled": true
},
{
"key": "filename",
"value": "sampleFileName",
"type": "text",
"description": "",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2019-01-10T10:16:10.847Z",
"_postman_exported_using": "Postman/6.5.3"
"_postman_exported_at": "2019-08-11T08:59:27.296Z",
"_postman_exported_using": "Postman/6.7.4"
}
Loading