Compare commits

..

No commits in common. "9a20462edee34b72a31f5eb009dd98f6aa56a4bc" and "05fc134281f0059508a4851f418f13c81a6995b1" have entirely different histories.

View File

@ -1,9 +1,7 @@
openapi: 3.0.0
info:
title: ClydeAPI
description:
This is the Clyde's api documentation. <br/>
Each endpoints are organised by endpoints **AND** by extensions making it easier to navigate.
description: Clyde's api
version: 0.0.1
servers:
@ -13,10 +11,10 @@ servers:
paths:
/ping:
get:
summary: Check the API status
summary: Vérifie l'état de l'api.
responses:
default:
description: pong
description: Retourne pong
content:
text/plain:
schema:
@ -24,9 +22,8 @@ paths:
example: pong
/users:
get:
summary: list all users
summary: Liste les utilisateurs
tags:
- General
- SI
security:
- bearer: []
@ -51,12 +48,9 @@ paths:
/user:
get:
summary: get informations about yourself
summary: Récupére ses informations
tags:
- General
- Users
security:
- bearer: []
responses:
'200':
description: Ok
@ -64,12 +58,9 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/User"
'401':
$ref: '#/components/responses/UnauthorizedError'
post:
summary: Create user
summary: Créer un utilisateur
tags:
- General
- Users
requestBody:
required: true
@ -95,7 +86,7 @@ paths:
"FirstName": "John",
"Email": "John.Doe@example.com",
"Address": {
"Address": "Rue de Tournais 42",
"Address": "Rue de Tounais 42",
"Country": "BE"},
"BirthDate": "1941-02-22",
}
@ -105,9 +96,8 @@ paths:
'401':
$ref: '#/components/responses/UnauthorizedError'
patch:
summary: Change informations about yourself
summary: modifier ses informations
tags:
- General
- Users
security:
- bearer: []
@ -119,10 +109,21 @@ paths:
$ref: '#/components/schemas/User'
responses:
'201':
description: Successfully changed.
description: Informations modifiées
'401':
$ref: '#/components/responses/UnauthorizedError'
/user/{mat}:
get:
summary: Récupérer les informations d'un utilisateur
tags:
- Admin
responses:
'200':
description: Utilisateur trouvé
content:
application/json:
schema:
$ref: "#/components/schemas/User"
parameters:
- name: mat
in: path
@ -130,22 +131,9 @@ paths:
required: true
schema:
type: integer
get:
summary: Get user's informations
tags:
- General
- Admin
responses:
'200':
description: User found
content:
application/json:
schema:
$ref: "#/components/schemas/User"
patch:
summary: Alter user's informations
summary: modifier les informations d'un utilisateur
tags:
- General
- Admin
- Secretariat
security:
@ -158,14 +146,14 @@ paths:
$ref: '#/components/schemas/User'
responses:
'201':
description: Successfully changed
description: Informations modifiées
'401':
$ref: '#/components/responses/UnauthorizedError'
/course:
post:
summary: Create new course
summary: Créer un nouveau cours
tags:
- General
- Courses
- Secretariat
security:
@ -185,14 +173,13 @@ paths:
type: string
responses:
'201':
description: course created
description: Nouveau cours crée
'401':
$ref: '#/components/responses/UnauthorizedError'
/courses/{id}:
get:
summary: see courses informations
summary: Voir les informations sur un cours
tags:
- General
- Courses
responses:
'200':
@ -208,9 +195,8 @@ paths:
schema:
type: integer
delete:
summary: delete a course
summary: Suprimer un cours
tags:
- General
- Courses
- Secretariat
security:
@ -221,9 +207,8 @@ paths:
'401':
$ref: '#/components/responses/UnauthorizedError'
patch:
summary: Change course options
summary: Changer les options du cours
tags:
- General
- Secretariat
- Courses
security:
@ -257,15 +242,14 @@ paths:
}
responses:
'201':
description: Course modified
description: Cours modifié
'401':
$ref: '#/components/responses/UnauthorizedError'
/cursus:
post:
summary: Create a cursus
summary: Créer un nouveau cursus
tags:
- General
- cursus
security:
- bearer: []
@ -278,26 +262,33 @@ paths:
properties:
name:
type: string
courses:
type: array
credits:
type: integer
faculty:
type: string
teachers:
$ref: '#/components/schemas/User'
assistants:
type: array
items:
type: integer
description: id of courses
$ref: '#/components/schemas/User'
example:
{
"name": "Bac1",
[]
"name": "Math pour l'info",
"credits": 11,
"faculty": "science",
"Teacher": ,
"Assistants": [ ]
}
responses:
'201':
description: Cursus created
description: Nouveau cursus crée
'401':
$ref: '#/components/responses/UnauthorizedError'
/cursus/{id}:
get:
summary: See Cursus's informations
summary: Voir les informations sur un cursus
tags:
- General
- cursus
responses:
'200':
@ -313,9 +304,8 @@ paths:
schema:
type: integer
delete:
summary: Delete cursus
summary: Suprimer un cursus
tags:
- General
- cursus
security:
- bearer: []
@ -325,9 +315,8 @@ paths:
'401':
$ref: '#/components/responses/UnauthorizedError'
patch:
summary: Modify cursus
summary: Changer les options du cursus
tags:
- General
- cursus
security:
- bearer: []
@ -360,7 +349,7 @@ paths:
}
responses:
'201':
description: Cursus modified
description: Cours modifié
'401':
$ref: '#/components/responses/UnauthorizedError'
@ -514,7 +503,7 @@ components:
"firstName": "John",
"email": "John.Doe@example.com",
"address": {
"address": "Rue de Tournais 42",
"address": "Rue de Tounais 42",
"country": "BE"},
"birthDate": "1941-02-22",
"staffMember": true,
@ -529,7 +518,7 @@ components:
description: Follow the ISO-3166-1 alpha-2 standard.
example:
{
"address": "Rue de Tournais 42",
"address": "Rue de Tounais 42",
"country": "BE"
}
Course:
@ -544,20 +533,18 @@ components:
faculty:
type: string
teachers:
type: integer
description: user's id
$ref: '#/components/schemas/User'
assistants:
type: array
items:
type: integer
description: user's id
$ref: '#/components/schemas/User'
example:
{
"id": 42,
"name": "Math pour l'info",
"credits": 11,
"faculty": "science",
"Teacher": 42,
"Teacher": ,
"Assistants": [ ]
}
Cursus:
@ -619,4 +606,5 @@ components:
responses:
UnauthorizedError:
description: Unauthorized access or missing bearer
description: Permission non accordée