Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
8463645-6003CEM-Backend-Resit-Deferral/schemas/openapi.yaml
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
221 lines (208 sloc)
6.12 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: 3.0.0 | |
info: | |
version: 1.0.0 | |
title: Web API Development Back End Demonstration API | |
description: A simple gym website API. | |
contact: | |
name: Miltos Skondras | |
email: skondram@coventry.ac.uk | |
license: | |
name: Apache 2.0 | |
url: 'https://www.apache.org/licenses/LICENSE-2.0.html' | |
servers: | |
- url: 'https://exile-region-3000.codio-box.uk/api/v1' | |
description: Development server | |
tags: | |
- name: Users | |
description: API endpoints for user management. | |
- name: Applications | |
description: Access and perform CRUD operations on application entries. | |
paths: | |
/users: | |
summary: Represents an individual user | |
description: > | |
This resource represents an individual user in the system. | |
Each user is identified by a numeric `id`. | |
post: | |
tags: | |
- Users | |
description: | |
Create a new user account. | |
requestBody: | |
description: All new user data. | |
required: true | |
content: | |
application/json: | |
schema: | |
$ref: ./user.json#/definitions/user | |
responses: | |
'201': | |
description: User created | |
content: | |
application/json: | |
schema: | |
$ref: ./user.json#/definitions/userUpdated | |
get: | |
tags: | |
- Users | |
description: | |
Get a list of all users. | |
responses: | |
'200': | |
description: List of users | |
content: | |
application/json: | |
schema: | |
$ref: ./user.json#/definitions/userList | |
'401': | |
description: Only admin users can list all accounts | |
/users/{id}: | |
parameters: | |
- in: path | |
name: id | |
schema: | |
type: integer | |
required: true | |
description: Numeric id of the user | |
get: | |
tags: | |
- Users | |
description: | |
Get user by id. | |
responses: | |
'200': | |
description: View of user record | |
content: | |
application/json: | |
schema: | |
$ref: ./user.json#/definitions/userView | |
'401': | |
description: Non-admin users can only view their own record | |
'404': | |
description: Not found | |
put: | |
tags: | |
- Users | |
description: | |
Update user by id. | |
requestBody: | |
description: Update a visible property or the password. | |
required: true | |
content: | |
application/json: | |
schema: | |
$ref: ./user.json#/definitions/userUpdate | |
responses: | |
'200': | |
description: Confirmation and link to record. | |
content: | |
application/json: | |
schema: | |
$ref: ./user.json#/definitions/userUpdated | |
'404': | |
description: Not found | |
delete: | |
tags: | |
- Users | |
description: | |
Delete user by id. | |
responses: | |
'200': | |
description: Confirmation of deletion. | |
content: | |
application/json: | |
schema: | |
$ref: ./user.json#/definitions/userDeleted | |
'401': | |
description: Only admin users can delete accounts | |
'404': | |
description: Not found | |
/applications: | |
summary: Represents membership application resource | |
description: This resource represents membership application resources stored within the database. | |
get: | |
tags: | |
- Applications | |
description: | |
Retrieve all membership applications from database. | |
responses: | |
'200': | |
description: All membership applications retrieved | |
content: | |
application/json: | |
schema: | |
$ref: ./application.json#/definitions/getAllApplications | |
post: | |
tags: | |
- Applications | |
description: | |
Create a membership application. | |
requestBody: | |
description: New membership application data added. | |
required: true | |
content: | |
application/json: | |
schema: | |
$ref: ./application.json#/definitions/application | |
responses: | |
'201': | |
description: Application submitted successfully. | |
content: | |
application/json: | |
schema: | |
$ref: ./application.json#/definitions/applicationCreation | |
'500': | |
description: Internal server error. | |
/applications/{id}: | |
parameters: | |
- in: path | |
name: id | |
content: | |
application/json | |
required: true | |
description: id of membership. | |
get: | |
tags: | |
- Applications | |
description: Retrieves membership application based on ID | |
responses: | |
'200': | |
description: Membership application returned. | |
content: | |
application/json: | |
schema: | |
$ref: ./application.json#/definitions/application | |
put: | |
tags: | |
- Applications | |
description: Update membership application by id | |
responses: | |
'200': | |
description: Application updated successfully. | |
content: | |
application/json: | |
schema: | |
$ref: ./application.json#/definitions/applicationCreation | |
'403': | |
description: Only admins have the necessary permissions to update this record. | |
'404': | |
description: Not Found. | |
'500': | |
description: Internal Server Error. | |
delete: | |
tags: | |
- Applications | |
description: Remove membership application by id | |
responses: | |
'200': | |
description: Membership application deleted successfully. | |
content: | |
application/json: | |
schema: | |
$ref: ./application.json#/definitions/applicationCreation | |
'403': | |
description: Only admins have the necessary necessary permissions to delete this record. | |
'404': | |
description: Not Found. | |
'500': | |
description: Internal Server Error. | |