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