Compare commits

..

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

View File

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