From 407b88114450a1c1e8cecb487448aa5afc52bafb Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Fri, 8 Dec 2023 13:38:42 +0100 Subject: [PATCH 1/5] added comment --- Documents/proto/general/openapi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 028edc6..43e9aba 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -1,3 +1,4 @@ +# hihi openapi: 3.0.0 info: title: ClydeAPI -- 2.46.0 From 05fc134281f0059508a4851f418f13c81a6995b1 Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Fri, 8 Dec 2023 17:17:40 +0100 Subject: [PATCH 2/5] Extension Article Scientifique ajout endpoint dans : secretariat, users, researcher ajout schemas : article --- Documents/proto/general/openapi.yaml | 165 ++++++++++++++++++++++++++- 1 file changed, 160 insertions(+), 5 deletions(-) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 43e9aba..5e0674a 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -1,4 +1,3 @@ -# hihi openapi: 3.0.0 info: title: ClydeAPI @@ -136,6 +135,7 @@ paths: summary: modifier les informations d'un utilisateur tags: - Admin + - Secretariat security: - bearer: [] requestBody: @@ -227,7 +227,6 @@ paths: faculty: type: string teachers: - type: object $ref: '#/components/schemas/User' assistants: type: array @@ -268,7 +267,6 @@ paths: faculty: type: string teachers: - type: object $ref: '#/components/schemas/User' assistants: type: array @@ -336,7 +334,6 @@ paths: faculty: type: string teachers: - type: object $ref: '#/components/schemas/User' assistants: type: array @@ -356,7 +353,125 @@ paths: '401': $ref: '#/components/responses/UnauthorizedError' + + + + + + + +# Extension publication scientifique + + /article: + post: + summary: create an article + tags: + - Researcher + security: + - bearer : [] + responses: + "201" : + description: OK + '401': + $ref: '#/components/responses/UnauthorizedError' + requestBody: + required : true + content: + application/pdf: + schema: + type: string + format : binary + application/json: + schema: + type: object + properties: + acces: + type: string + summary: + type: string + language: + type: string + title: + type: string + date: + type: string + description: Follow the iso 8601 ("YYYY-MM-DD") + views: + type: integer #TODO check comment envoyer fichier + json + /article/{id}: + parameters: + - name: id + in: path + required: true + schema: + type: integer + get: + summary: get a certain article + tags: + - Users + security: + - bearer: [] + responses: + "201": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Article' + '401': + $ref: '#/components/responses/UnauthorizedError' + patch: + summary: modify an article + tags: + - Researcher + security: + - bearer : [] + responses: + "201": + description: article modifié + '401': + $ref: '#/components/responses/UnauthorizedError' + requestBody: + required : true + content: + application/pdf: + schema: + type: string + format : binary + application/json: + schema: + type: object + properties: + acces: + type: string + summary: + type: string + language: + type: string + title: + type: string + date: + type: string + description: Follow the iso 8601 ("YYYY-MM-DD") + views: + type: integer + + delete: + summary: delete own article + tags: + - Researcher + security: + - bearer: [] + responses: + '201': + description: OK + '401': + $ref: '#/components/responses/UnauthorizedError' + + + + components: securitySchemes: bearer: @@ -418,7 +533,6 @@ components: faculty: type: string teachers: - type: object $ref: '#/components/schemas/User' assistants: type: array @@ -449,6 +563,47 @@ components: "id": 42, "courses": ['Math', 'Info'] } + + Article: + type: object + properties: + articleId: + type: integer + acces : + type : string + pdf : + type : string + description : file location + summary: + type : string + language: + type : string + title : + type : string + date: + type : string + views : + type : integer + authors: + type: array + items: + $ref: '#/components/schemas/User' + description: first user is the author, the remaining users are co-authors + example: + { + "articleId": 42, + "acces": "private", + "pdf": "/articles/42", + "summary": "looks in details about graph's second theorem", + "language": "english", + "title": "graph's second theorem study", + "date":"2023-02-01", + "views": 420, + "authors" : [] + } + + + responses: UnauthorizedError: description: Permission non accordée -- 2.46.0 From dc559cefeec9b83216c57087ae2b92af1dd37e38 Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Mon, 11 Dec 2023 11:27:34 +0100 Subject: [PATCH 3/5] added the Ext (scientific articles) tag --- Documents/proto/general/openapi.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 06bb2ff..f1acf19 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -148,6 +148,7 @@ paths: - General - Admin - Secretariat + - Ext (scientific articles) security: - bearer: [] requestBody: @@ -377,6 +378,7 @@ paths: post: summary: create an article tags: + - Ext (scientific articles) - Researcher security: - bearer : [] @@ -420,6 +422,7 @@ paths: summary: get a certain article tags: - Users + - Ext (scientific articles) security: - bearer: [] responses: @@ -436,6 +439,7 @@ paths: summary: modify an article tags: - Researcher + - Ext (scientific articles) security: - bearer : [] responses: @@ -472,6 +476,7 @@ paths: summary: delete own article tags: - Researcher + - Ext (scientific articles) security: - bearer: [] responses: -- 2.46.0 From 67552901d6e5b6311d290a2248a420b9d9591cf4 Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Tue, 12 Dec 2023 14:36:15 +0100 Subject: [PATCH 4/5] ajout Display-Article (et Mat -> RegNo) --- Documents/proto/general/openapi.yaml | 115 ++++++++++++++++++++++----- 1 file changed, 96 insertions(+), 19 deletions(-) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index f1acf19..7a25336 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -122,11 +122,11 @@ paths: description: Successfully changed. '401': $ref: '#/components/responses/UnauthorizedError' - /user/{mat}: + /user/{RegNo}: parameters: - - name: mat + - name: RegNo in: path - description: Matricule of the user (unique id) + description: Regestration number of the user (unique id) required: true schema: type: integer @@ -390,15 +390,14 @@ paths: requestBody: required : true content: - application/pdf: - schema: - type: string - format : binary application/json: schema: type: object properties: - acces: + pdf: + type: string + description : the B64 version encoding of the pdf file + access: type: string summary: type: string @@ -410,7 +409,19 @@ paths: type: string description: Follow the iso 8601 ("YYYY-MM-DD") views: - type: integer #TODO check comment envoyer fichier + json + type: integer + example: + { + "access": "private", + "pdf": " *the b64 encoding of the pdf* ", + "summary": "looks in details about graph's second theorem", + "language": "english", + "title": "graph's second theorem study", + "date":"2023-02-01", + "views": 420, + "authors" : [] + } + /article/{id}: parameters: - name: id @@ -450,15 +461,14 @@ paths: requestBody: required : true content: - application/pdf: - schema: - type: string - format : binary application/json: schema: type: object properties: - acces: + pdf: + type: string + description : the B64 version encoding of the pdf file + access: type: string summary: type: string @@ -471,6 +481,18 @@ paths: description: Follow the iso 8601 ("YYYY-MM-DD") views: type: integer + example: + { + "access": "public", + "pdf": " *the new b64 encoding of the pdf* ", + "summary": "looks in details about the duck's algorithm problem", + "language": "english", + "title": "duck's algorithm problem solving", + "date":"2023-02-01", + "views": 10, + "authors" : [] + } + delete: summary: delete own article @@ -485,8 +507,39 @@ paths: '401': $ref: '#/components/responses/UnauthorizedError' - - + /Display-Article: + parameters: + - in: query + name: author + required: false + schema: + type: string + - in: query + name: access + required: false + schema: + type: string + enum: [public, restricted, private] + - in: query + name: name + required: false + schema: + type: string + + get: + summary: get a list of article's data + tags: + - Users + - Ext (scientific articles) + responses: + '200': + description: OK + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Display-Article" components: securitySchemes: @@ -587,7 +640,7 @@ components: properties: articleId: type: integer - acces : + access : type : string pdf : type : string @@ -610,7 +663,7 @@ components: example: { "articleId": 42, - "acces": "private", + "access": "private", "pdf": "/articles/42", "summary": "looks in details about graph's second theorem", "language": "english", @@ -619,9 +672,33 @@ components: "views": 420, "authors" : [] } - + Display-Article: + type: object + properties: + articleId: + type: integer + access: + type: string + summary: + type: string + title: + type: string + author: + type: string + items: + $ref: '#/components/schemas/User' + example: + { + "articleId": 42, + "access": "private", + "summary": "looks in details about graph's second theorem", + "title": "graph's second theorem study", + "author" : "john doe" + } responses: UnauthorizedError: description: Unauthorized access or missing bearer + + -- 2.46.0 From c807568689a9069beaba2cdde987c7cd386589eb Mon Sep 17 00:00:00 2001 From: Bartha Maxime <231026@umons.ac.be> Date: Wed, 13 Dec 2023 14:41:07 +0100 Subject: [PATCH 5/5] Dispay-Article -> DisplayArticle --- Documents/proto/general/openapi.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documents/proto/general/openapi.yaml b/Documents/proto/general/openapi.yaml index 7a25336..7081464 100644 --- a/Documents/proto/general/openapi.yaml +++ b/Documents/proto/general/openapi.yaml @@ -507,7 +507,7 @@ paths: '401': $ref: '#/components/responses/UnauthorizedError' - /Display-Article: + /DisplayArticle: parameters: - in: query name: author @@ -539,7 +539,7 @@ paths: schema: type: array items: - $ref: "#/components/schemas/Display-Article" + $ref: "#/components/schemas/DisplayArticle" components: securitySchemes: @@ -672,7 +672,7 @@ components: "views": 420, "authors" : [] } - Display-Article: + DisplayArticle: type: object properties: articleId: @@ -702,3 +702,4 @@ components: description: Unauthorized access or missing bearer + -- 2.46.0