-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3f8349
commit 99e1e67
Showing
1 changed file
with
116 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,140 @@ | ||
openapi: 3.0.0 | ||
info: | ||
version: 0.1.0 | ||
title: "Sport Challenge" | ||
title: Sport Challenge | ||
description: | | ||
API for the Sport Challenge Backend. Can be used to build a frontend from the App. | ||
paths: | ||
/account: | ||
get: | ||
description: "Returns the Account object for the current user/session." | ||
response: | ||
description: Returns the Account object for the current Account/Session. | ||
tags: | ||
- account | ||
responses: | ||
200: | ||
description: "Successful response" | ||
description: Successful response | ||
$ref: '#/components/responses/Account' | ||
403: | ||
description: "User is not logged in/ Session is not valid" | ||
description: User is not logged in/ Session is not valid | ||
|
||
post: | ||
description: "For creating a new account/ Signing Up" | ||
respone: | ||
description: For creating a new account/ Signing Up | ||
tags: | ||
- account | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/CreateAccount' | ||
responses: | ||
200: | ||
$ref: '#/components/responses/Account' | ||
409: | ||
description: The username or email was already in use | ||
|
||
put: | ||
description: Edit the properties of the current Account (except the password, which has to be set by a seperate route). | ||
tags: | ||
- account | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/EditAccount' | ||
responses: | ||
200: | ||
description: "Successful response" | ||
description: Successful response | ||
$ref: '#/components/responses/Account' | ||
403: | ||
description: User is not logged in/ Session is not valid | ||
409: | ||
description: The username or email was already in use | ||
|
||
delete: | ||
description: (Permanently!!!) Delete the current Account. | ||
tags: | ||
- account | ||
responses: | ||
200: | ||
description: Successful response | ||
$ref: '#/components/responses/Account' | ||
403: | ||
description: User is not logged in/ Session is not valid | ||
|
||
/account/password: | ||
put: | ||
description: Edit the Password of the current Account. | ||
tags: | ||
- account | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
pasword: | ||
type: string | ||
responses: | ||
200: | ||
description: Successful response | ||
$ref: '#/components/responses/Account' | ||
403: | ||
description: User is not logged in/ Session is not valid | ||
|
||
/users/id/{id}: | ||
get: | ||
description: Returns the public profile of an User. | ||
responses: | ||
200: | ||
description: Successful response | ||
$ref: '#/components/responses/User' | ||
204: | ||
description: User with the id does not exist | ||
403: | ||
description: User is not logged in/ Session is not valid | ||
/user/{username}: | ||
get: | ||
description: Returns the public profile of an User. | ||
responses: | ||
200: | ||
description: Successful response | ||
$ref: '#/components/responses/User' | ||
204: | ||
description: User with the username does not exist | ||
401: | ||
description: Current Session is not Authorized | ||
|
||
components: | ||
schemas: | ||
Account: | ||
CreateAccount: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
format: i64 | ||
username: | ||
type: string | ||
PostAccount: | ||
password: | ||
type: string | ||
EditAccount: | ||
type: object | ||
properties: | ||
username: | ||
type: string | ||
password: | ||
type: string | ||
EditAccount: | ||
|
||
responses: | ||
Account: | ||
description: Account object | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
format: i64 | ||
username: | ||
type: string | ||
password_hash: | ||
type: string |