Skip to content
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

Sprint 4 - Swagger/Postman Updates #109

Merged
merged 1 commit into from
Jan 23, 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
116 changes: 107 additions & 9 deletions api/postman/bookings-postman.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,10 @@
" \"sb_id\": {\"type\": \"number\"}",
" },",
" \"required\": [\"exams_enabled_ind\", \"office_id\", \"office_name\", \"office_number\", \"sb\", \"sb_id\"]",
" }",
" },",
" \"offsite_location\": {}",
" },",
" \"required\": [\"booking\", \"exam_received\", \"exam_received_date\", \"exam_type\", \"examinee_name\", \"exam_name\", \"expiry_date\", \"notes\", \"exam_method\", \"office_id\", \"session_number\", \"booking_id\", \"deleted_date\", \"exam_id\", \"number_of_students\", \"exam_type_id\", \"event_id\", \"exam_returned_tracking_number\", \"exam_returned_ind\"]",
" \"required\": [\"booking\", \"exam_received\", \"exam_received_date\", \"exam_type\", \"examinee_name\", \"exam_name\", \"expiry_date\", \"notes\", \"exam_method\", \"office_id\", \"session_number\", \"booking_id\", \"deleted_date\", \"exam_id\", \"number_of_students\", \"exam_type_id\", \"event_id\", \"exam_returned_tracking_number\", \"exam_returned_ind\", \"offsite_location\"]",
" },",
" \"errors\": {",
" \"type\": \"object\",",
Expand Down Expand Up @@ -404,9 +405,10 @@
" \"sb_id\": {\"type\": \"number\"}",
" },",
" \"required\": [\"exams_enabled_ind\", \"office_id\", \"office_name\", \"office_number\", \"sb\", \"sb_id\"]",
" }",
" },",
" \"offsite_location\": {}",
" },",
" \"required\": [\"booking\", \"exam_received\", \"exam_received_date\", \"exam_type\", \"examinee_name\", \"exam_name\", \"expiry_date\", \"notes\", \"exam_method\", \"office_id\", \"session_number\", \"booking_id\", \"deleted_date\", \"exam_id\", \"number_of_students\", \"exam_type_id\", \"event_id\", \"exam_returned_tracking_number\", \"exam_returned_ind\"]",
" \"required\": [\"booking\", \"exam_received\", \"exam_received_date\", \"exam_type\", \"examinee_name\", \"exam_name\", \"expiry_date\", \"notes\", \"exam_method\", \"office_id\", \"session_number\", \"booking_id\", \"deleted_date\", \"exam_id\", \"number_of_students\", \"exam_type_id\", \"event_id\", \"exam_returned_tracking_number\", \"exam_returned_ind\", \"offsite_location\"]",
" },",
" \"errors\": {",
" \"type\": \"object\",",
Expand Down Expand Up @@ -528,9 +530,10 @@
" \"sb_id\": {\"type\": \"number\"}",
" },",
" \"required\": [\"exams_enabled_ind\", \"office_id\", \"office_name\", \"office_number\", \"sb\", \"sb_id\"]",
" }",
" },",
" \"offsite_location\": {}",
" },",
" \"required\": [\"booking\", \"exam_received\", \"exam_received_date\", \"exam_type\", \"examinee_name\", \"exam_name\", \"expiry_date\", \"notes\", \"exam_method\", \"office_id\", \"session_number\", \"booking_id\", \"deleted_date\", \"exam_id\", \"number_of_students\", \"exam_type_id\", \"event_id\", \"exam_returned_tracking_number\", \"exam_returned_ind\"]",
" \"required\": [\"booking\", \"exam_received\", \"exam_received_date\", \"exam_type\", \"examinee_name\", \"exam_name\", \"expiry_date\", \"notes\", \"exam_method\", \"office_id\", \"session_number\", \"booking_id\", \"deleted_date\", \"exam_id\", \"number_of_students\", \"exam_type_id\", \"event_id\", \"exam_returned_tracking_number\", \"exam_returned_ind\", \"offsite_location\"]",
" },",
" \"errors\": {",
" \"type\": \"object\",",
Expand Down Expand Up @@ -739,9 +742,10 @@
" \"sb_id\": {\"type\": \"number\"}",
" },",
" \"required\": [\"exams_enabled_ind\", \"office_id\", \"office_name\", \"office_number\", \"sb\", \"sb_id\"]",
" }",
" },",
" \"offsite_location\": {}",
" },",
" \"required\": [\"booking\", \"exam_received\", \"exam_received_date\", \"exam_type\", \"examinee_name\", \"exam_name\", \"expiry_date\", \"notes\", \"exam_method\", \"office_id\", \"session_number\", \"booking_id\", \"deleted_date\", \"exam_id\", \"number_of_students\", \"exam_type_id\", \"event_id\", \"exam_returned_tracking_number\", \"exam_returned_ind\"]",
" \"required\": [\"booking\", \"exam_received\", \"exam_received_date\", \"exam_type\", \"examinee_name\", \"exam_name\", \"expiry_date\", \"notes\", \"exam_method\", \"office_id\", \"session_number\", \"booking_id\", \"deleted_date\", \"exam_id\", \"number_of_students\", \"exam_type_id\", \"event_id\", \"exam_returned_tracking_number\", \"exam_returned_ind\", \"offsite_location\"]",
" },",
" \"errors\": {",
" \"type\": \"object\",",
Expand Down Expand Up @@ -1924,6 +1928,100 @@
"response": []
}
]
},
{
"name": "Offices",
"item": [
{
"name": "Localhost - Office List End-point",
"event": [
{
"listen": "test",
"script": {
"id": "ad6ffb6d-efad-4e11-b4a9-99e49f457bbd",
"exec": [
"// Define the JSON Schema expected in response",
"var officeSchema = {",
" \"type\": \"object\",",
" \"properties\": {",
" \"offices\": {",
" \"type\": \"array\",",
" \"properties\": {",
" \"exams_enabled\": {\"type\": \"number\"},",
" \"office_id\": {\"type\": \"number\"},",
" \"office_name\": {\"type\": \"string\"},",
" \"office_number\": {\"type\": \"number\"},",
" \"sb\": {",
" \"type\": \"object\",",
" \"properties\": {",
" \"sb_id\": {\"type\": \"number\"},",
" \"sb_type\": {\"type\": \"string\"}",
" },",
" \"required\": [\"sb_id\", \"sb_type\"]",
" },",
" \"sb_id\": {\"type\": \"number\"}",
" },",
" \"required\": [\"exams_enabled\", \"office_id\", \"office_name\", \"office_number\", \"sb\", \"sb_id\"]",
" }",
" }",
"};",
"",
"// Check Response code for request",
"pm.test(\"Response code for request is 200\", function(){",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Response time less than 1000ms\", function(){",
" pm.expect(pm.response.responseTime).to.be.below(1000);",
"});",
"",
"// Parse response body",
"var jsonData = JSON.parse(responseBody);",
"",
"//Test to see if response schema is valid",
"pm.test(\"Validate Response Exam Schema\", function(){",
" pm.expect(tv4.validate(jsonData, officeSchema)).to.be.true;",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "http://localhost:5000/api/v1/offices/",
"protocol": "http",
"host": [
"localhost"
],
"port": "5000",
"path": [
"api",
"v1",
"offices",
""
]
}
},
"response": []
}
]
}
],
"event": [
Expand All @@ -1950,7 +2048,7 @@
],
"variable": [
{
"id": "763ee312-61d7-4fca-8c29-46a8508a9b94",
"id": "04bc42c3-7393-4b06-b728-d27d89110ef8",
"key": "auth_variable",
"value": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI1NXhiZzcyaml6NWQ3cEtkbzdwNFhLdTB2VFA2UXMtemthZzFaY1ZKWTZVIn0.eyJqdGkiOiJmZWVlYzU4YS0zOTY0LTQwZDgtOTk3Ni02OTg1ZjNiNmQ2NzYiLCJleHAiOjE1NDQwMzY2NzQsIm5iZiI6MCwiaWF0IjoxNTQ0MDM0ODc0LCJpc3MiOiJodHRwczovL3Nzby10ZXN0LnBhdGhmaW5kZXIuZ292LmJjLmNhL2F1dGgvcmVhbG1zL3NiYyIsImF1ZCI6ImNmbXMtREVWIiwic3ViIjoiY2ZmNTQ3MDItZTkzMC00YjZlLTlhYzgtMmZkMTRjY2FmNzUxIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiY2Ztcy1ERVYiLCJub25jZSI6ImM1Zjg1NzBmLTgwNDktNDUxNC04Mjg4LTJjN2RmMzdkZTc5NSIsImF1dGhfdGltZSI6MTU0NDAzMjgxNywic2Vzc2lvbl9zdGF0ZSI6IjM4YjhiYzY4LTdmZDktNDE0NC04YWQ1LTI4ZGRlNmMwYWE1MCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJuYW1lIjoiQ0ZNUyBQb3N0bWFuIE9wZXJhdG9yIiwicHJlZmVycmVkX3VzZXJuYW1lIjoiY2Ztcy1wb3N0bWFuLW9wZXJhdG9yIiwiZ2l2ZW5fbmFtZSI6IkNGTVMgUG9zdG1hbiIsImZhbWlseV9uYW1lIjoiT3BlcmF0b3IifQ.CaDq7kLDMu1oqUVm6fhiAw4ubu_D4jVdkXrqLjfCxu9b-9GzyNSIK1Gy0NCesN3caG684-Ofv3LlragMOwdoRhx-xkO6j5rqPhh2EdEDYTGkrnmQrVBjgHECLYN3RSAUWk4oKsp7gRMLDorU6QWLZNRWe9qlzulbss08Mut4nZz1RV0CirvJQ9oshBdpstQIPBM7ZEptcF2AOnc8swcFMJ3mqdrs0ImytArwZEzYwRzSIAR0-kYW-AXq-TK1dk2R7fqkMXmy3ZdHoQlFRfNtfYILVPzBAq3zPftrD-lmCcfUWz-0UcwhmNELQ-Pej-t_Z_eFSPPGkAVIuv_kkHbqQw",
"type": "string"
Expand Down
3 changes: 3 additions & 0 deletions documentation/open-api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ components:
exam_returned_tracking_number:
type: string
nullable: true
offsite_location:
type: string
nullable: true
booking:
allOf:
- $ref: "#/components/schemas/Booking"
Expand Down