Skip to content

Commit

Permalink
#15 - Updating the OpenAPI specifications
Browse files Browse the repository at this point in the history
  • Loading branch information
JarneClauw committed Feb 26, 2024
1 parent d2f4b70 commit 01bd8a8
Show file tree
Hide file tree
Showing 2 changed files with 376 additions and 6 deletions.
373 changes: 372 additions & 1 deletion backend/project/endpoints/index/OpenAPI_Object.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,376 @@
}
]
},
"paths": []
"paths": {
"/submissions/{uid}/{pid}": {
"get": {
"summary": "Get all submissions from a user for a project",
"responses": {
"200": {
"description": "A list of submission URLs",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"submissions": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"404": {
"description": "A 'not found' message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "An error message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
}
},
"post": {
"summary": "Post a new submission to a project",
"requestBody": {
"description": "Grading",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"grading": {
"type": "int",
"minimum": 0,
"maximum": 20
}
}
}
}
}
},
"responses": {
"201": {
"description": "The newly created submission URL",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"submission": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "A 'bad data field' message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"404": {
"description": "A 'not found' message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "An error message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
}
},
"parameters": [
{
"name": "uid",
"in": "path",
"description": "User ID",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "pid",
"in": "path",
"description": "Project ID",
"required": true,
"schema": {
"type": "int"
}
}
]
},
"/submissions/{sid}": {
"get": {
"summary": "Get the submission",
"responses": {
"200": {
"description": "The submission",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"submission_id": {
"type": "int"
},
"uid": {
"type": "string"
},
"project_id": {
"type": "int"
},
"grading": {
"type": "int"
},
"submission_time": {
"type": "string"
},
"submission_path": {
"type": "string"
},
"submission_status": {
"type": "int"
}
}
}
}
}
},
"404": {
"description": "A 'not found' message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "An error message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
}
},
"patch": {
"summary": "Update the submission",
"requestBody": {
"description": "The submission data",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"grading": {
"type": "int",
"minimum": 0,
"maximum": 20
}
}
}
}
}
},
"responses": {
"200": {
"description": "A 'submission updated' message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "A 'bad data field' message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"404": {
"description": "A 'not found' message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "An error message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
}
},
"delete": {
"summary": "Delete the submission",
"responses": {
"200": {
"description": "A 'submission deleted' message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"404": {
"description": "A 'not found' message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "An error message",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
}
},
"parameters": [
{
"name": "sid",
"in": "path",
"description": "Submission ID",
"required": true,
"schema": {
"type": "int"
}
}
]
}
}
}
Loading

0 comments on commit 01bd8a8

Please sign in to comment.