Skip to content

Commit b335e5c

Browse files
authored
Merge pull request #127 from topcoder-platform/contest-1
Sync Swagger with code and 2 enhancements
2 parents f995692 + 170867d commit b335e5c

23 files changed

+639
-137
lines changed

docs/Submission API.postman_collection.json

Lines changed: 238 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"info": {
3-
"_postman_id": "9776607d-8485-4e67-bd2a-55e0b5100580",
3+
"_postman_id": "567b1b26-0edf-4f9f-9f69-ed0b35f8422c",
44
"name": "Submission API",
55
"description": "Topcoder Submission API Postman Collection",
66
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
@@ -410,6 +410,58 @@
410410
},
411411
"response": []
412412
},
413+
{
414+
"name": "GET Review types from ES with sortBy",
415+
"event": [
416+
{
417+
"listen": "test",
418+
"script": {
419+
"id": "290c7b35-fc15-468e-81a8-bd2a4eefcd27",
420+
"exec": [
421+
""
422+
],
423+
"type": "text/javascript"
424+
}
425+
}
426+
],
427+
"request": {
428+
"method": "GET",
429+
"header": [
430+
{
431+
"key": "Authorization",
432+
"value": "Bearer {{ADMIN_TOKEN}}"
433+
},
434+
{
435+
"key": "Content-Type",
436+
"value": "application/json"
437+
}
438+
],
439+
"body": {
440+
"mode": "raw",
441+
"raw": ""
442+
},
443+
"url": {
444+
"raw": "{{URL}}/reviewTypes?sortBy=created&orderBy=desc",
445+
"host": [
446+
"{{URL}}"
447+
],
448+
"path": [
449+
"reviewTypes"
450+
],
451+
"query": [
452+
{
453+
"key": "sortBy",
454+
"value": "created"
455+
},
456+
{
457+
"key": "orderBy",
458+
"value": "desc"
459+
}
460+
]
461+
}
462+
},
463+
"response": []
464+
},
413465
{
414466
"name": "GET Review types from ES with invalid filters",
415467
"event": [
@@ -749,13 +801,13 @@
749801
"listen": "test",
750802
"script": {
751803
"id": "b0a4b893-f851-47bb-8b41-5dc60ba76fa0",
752-
"type": "text/javascript",
753804
"exec": [
754805
"if( responseCode.code === 200) {",
755806
" const response = JSON.parse(responseBody);",
756807
" pm.environment.set(\"reviewID\", response.id);",
757808
"}"
758-
]
809+
],
810+
"type": "text/javascript"
759811
}
760812
}
761813
],
@@ -773,7 +825,7 @@
773825
],
774826
"body": {
775827
"mode": "raw",
776-
"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}"
828+
"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}"
777829
},
778830
"url": {
779831
"raw": "{{URL}}/reviews",
@@ -1101,6 +1153,54 @@
11011153
},
11021154
"response": []
11031155
},
1156+
{
1157+
"name": "GET Reviews from ES with sortBy",
1158+
"event": [
1159+
{
1160+
"listen": "test",
1161+
"script": {
1162+
"id": "290c7b35-fc15-468e-81a8-bd2a4eefcd27",
1163+
"exec": [
1164+
""
1165+
],
1166+
"type": "text/javascript"
1167+
}
1168+
}
1169+
],
1170+
"request": {
1171+
"method": "GET",
1172+
"header": [
1173+
{
1174+
"key": "Authorization",
1175+
"value": "Bearer {{ADMIN_TOKEN}}"
1176+
},
1177+
{
1178+
"key": "Content-Type",
1179+
"value": "application/json"
1180+
}
1181+
],
1182+
"body": {
1183+
"mode": "raw",
1184+
"raw": ""
1185+
},
1186+
"url": {
1187+
"raw": "{{URL}}/reviews?sortBy=score",
1188+
"host": [
1189+
"{{URL}}"
1190+
],
1191+
"path": [
1192+
"reviews"
1193+
],
1194+
"query": [
1195+
{
1196+
"key": "sortBy",
1197+
"value": "score"
1198+
}
1199+
]
1200+
}
1201+
},
1202+
"response": []
1203+
},
11041204
{
11051205
"name": "GET Reviews from ES with invalid filters",
11061206
"event": [
@@ -1284,10 +1384,10 @@
12841384
"listen": "test",
12851385
"script": {
12861386
"id": "f13eec0d-52e8-4650-b1b0-2db09992067b",
1287-
"type": "text/javascript",
12881387
"exec": [
12891388
""
1290-
]
1389+
],
1390+
"type": "text/javascript"
12911391
}
12921392
}
12931393
],
@@ -1305,7 +1405,7 @@
13051405
],
13061406
"body": {
13071407
"mode": "raw",
1308-
"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}"
1408+
"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}"
13091409
},
13101410
"url": {
13111411
"raw": "{{URL}}/reviews/{{reviewID}}",
@@ -1483,13 +1583,13 @@
14831583
"listen": "test",
14841584
"script": {
14851585
"id": "9a901742-45ac-4e6e-b3c5-3379ed7e74bf",
1486-
"type": "text/javascript",
14871586
"exec": [
14881587
"if( responseCode.code === 200) {",
14891588
" const response = JSON.parse(responseBody);",
14901589
" pm.environment.set(\"reviewSummationID\", response.id);",
14911590
"}"
1492-
]
1591+
],
1592+
"type": "text/javascript"
14931593
}
14941594
}
14951595
],
@@ -1507,7 +1607,7 @@
15071607
],
15081608
"body": {
15091609
"mode": "raw",
1510-
"raw": "{\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"aggregateScore\": 97.8,\n\t\"scoreCardId\": \"d46a4180-65aa-42ec-a945-5fd21d3d26f8\",\n\t\"isPassing\": true\n}"
1610+
"raw": "{\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"aggregateScore\": 97.8,\n\t\"scoreCardId\": 123456789,\n\t\"isPassing\": true\n}"
15111611
},
15121612
"url": {
15131613
"raw": "{{URL}}/reviewSummations",
@@ -1831,6 +1931,58 @@
18311931
},
18321932
"response": []
18331933
},
1934+
{
1935+
"name": "GET Review Summations from ES with sortBy",
1936+
"event": [
1937+
{
1938+
"listen": "test",
1939+
"script": {
1940+
"id": "290c7b35-fc15-468e-81a8-bd2a4eefcd27",
1941+
"exec": [
1942+
""
1943+
],
1944+
"type": "text/javascript"
1945+
}
1946+
}
1947+
],
1948+
"request": {
1949+
"method": "GET",
1950+
"header": [
1951+
{
1952+
"key": "Authorization",
1953+
"value": "Bearer {{ADMIN_TOKEN}}"
1954+
},
1955+
{
1956+
"key": "Content-Type",
1957+
"value": "application/json"
1958+
}
1959+
],
1960+
"body": {
1961+
"mode": "raw",
1962+
"raw": ""
1963+
},
1964+
"url": {
1965+
"raw": "{{URL}}/reviewSummations?sortBy=aggregateScore&orderBy=DESC",
1966+
"host": [
1967+
"{{URL}}"
1968+
],
1969+
"path": [
1970+
"reviewSummations"
1971+
],
1972+
"query": [
1973+
{
1974+
"key": "sortBy",
1975+
"value": "aggregateScore"
1976+
},
1977+
{
1978+
"key": "orderBy",
1979+
"value": "DESC"
1980+
}
1981+
]
1982+
}
1983+
},
1984+
"response": []
1985+
},
18341986
{
18351987
"name": "GET Review Summations from ES with invalid filters",
18361988
"event": [
@@ -2014,10 +2166,10 @@
20142166
"listen": "test",
20152167
"script": {
20162168
"id": "f13eec0d-52e8-4650-b1b0-2db09992067b",
2017-
"type": "text/javascript",
20182169
"exec": [
20192170
""
2020-
]
2171+
],
2172+
"type": "text/javascript"
20212173
}
20222174
}
20232175
],
@@ -2035,7 +2187,7 @@
20352187
],
20362188
"body": {
20372189
"mode": "raw",
2038-
"raw": "{\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"aggregateScore\": 93.5,\n\t\"scoreCardId\": \"d46a4180-65aa-42ec-a945-5fd21d3d26f8\",\n\t\"isPassing\": true\n}"
2190+
"raw": "{\n\t\"submissionId\": \"{{submissionID}}\",\n\t\"aggregateScore\": 93.5,\n\t\"scoreCardId\": 123456789,\n\t\"isPassing\": true\n}"
20392191
},
20402192
"url": {
20412193
"raw": "{{URL}}/reviewSummations/{{reviewSummationID}}",
@@ -2491,6 +2643,42 @@
24912643
},
24922644
"response": []
24932645
},
2646+
{
2647+
"name": "Get Submissions from ES with sortBy",
2648+
"request": {
2649+
"method": "GET",
2650+
"header": [
2651+
{
2652+
"key": "Authorization",
2653+
"value": "Bearer {{USER_TOKEN}}"
2654+
}
2655+
],
2656+
"body": {
2657+
"mode": "raw",
2658+
"raw": ""
2659+
},
2660+
"url": {
2661+
"raw": "{{URL}}/submissions?sortBy=created&orderBy=asc",
2662+
"host": [
2663+
"{{URL}}"
2664+
],
2665+
"path": [
2666+
"submissions"
2667+
],
2668+
"query": [
2669+
{
2670+
"key": "sortBy",
2671+
"value": "created"
2672+
},
2673+
{
2674+
"key": "orderBy",
2675+
"value": "asc"
2676+
}
2677+
]
2678+
}
2679+
},
2680+
"response": []
2681+
},
24942682
{
24952683
"name": "Get Submissions from ES with invalid filters",
24962684
"request": {
@@ -2761,6 +2949,11 @@
27612949
"key": "typeId",
27622950
"value": "{{artifactID}}",
27632951
"type": "text"
2952+
},
2953+
{
2954+
"key": "filename",
2955+
"value": "{{filename}}",
2956+
"type": "text"
27642957
}
27652958
]
27662959
},
@@ -2927,6 +3120,38 @@
29273120
}
29283121
},
29293122
"response": []
3123+
},
3124+
{
3125+
"name": "Get Submissions from ES with filters Copy",
3126+
"request": {
3127+
"method": "GET",
3128+
"header": [
3129+
{
3130+
"key": "Authorization",
3131+
"value": "Bearer {{USER_TOKEN}}"
3132+
}
3133+
],
3134+
"body": {
3135+
"mode": "raw",
3136+
"raw": ""
3137+
},
3138+
"url": {
3139+
"raw": "{{URL}}/submissions?type=ContestSubmission",
3140+
"host": [
3141+
"{{URL}}"
3142+
],
3143+
"path": [
3144+
"submissions"
3145+
],
3146+
"query": [
3147+
{
3148+
"key": "type",
3149+
"value": "ContestSubmission"
3150+
}
3151+
]
3152+
}
3153+
},
3154+
"response": []
29303155
}
29313156
],
29323157
"description": "End points related to Submission",

docs/submission-api.postman_environment.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "eac995de-0f91-4dd2-a4c7-dab75cc3037e",
2+
"id": "9f46d01c-0036-4350-aa00-c6860b4450de",
33
"name": "submission-api",
44
"values": [
55
{
@@ -36,9 +36,16 @@
3636
"value": "c56a4180-65aa-42ec-a945-5fd21dec0503",
3737
"description": "",
3838
"enabled": true
39+
},
40+
{
41+
"key": "filename",
42+
"value": "sampleFileName",
43+
"type": "text",
44+
"description": "",
45+
"enabled": true
3946
}
4047
],
4148
"_postman_variable_scope": "environment",
42-
"_postman_exported_at": "2019-01-10T10:16:10.847Z",
43-
"_postman_exported_using": "Postman/6.5.3"
49+
"_postman_exported_at": "2019-08-11T08:59:27.296Z",
50+
"_postman_exported_using": "Postman/6.7.4"
4451
}

0 commit comments

Comments
 (0)