From 8d8d593fe323e601b6aadfb8b7eb4f6b1b333cbb Mon Sep 17 00:00:00 2001 From: jboinembalome Date: Fri, 27 Nov 2020 15:54:06 +0100 Subject: [PATCH] =?UTF-8?q?MAJ=20des=20urls=20pour=20la=20partie=20note=20?= =?UTF-8?q?en=20fonction=20des=20sp=C3=A9cifications=20techniques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi.yaml | 32 ++++----- parameters/path/idAuteur.yaml | 2 +- paths/note/noteById.yaml | 16 ----- paths/note/notes.yaml | 30 +++++---- .../{notesAuteur.yaml => notesIdAuteur.yaml} | 18 +++-- paths/note/notesIdAuteurCount.yaml | 27 ++++++++ paths/note/notesIdNote.yaml | 65 +++++++++++++++++++ paths/note/notesParCollaborateur.yaml | 22 ------- paths/note/nouvelleNote.yaml | 12 ---- paths/note/supprimerNote.yaml | 16 ----- paths/note/updateNote.yaml | 18 ----- responses/erreur/notfound.yaml | 2 +- responses/erreur/unsupportedMediaType.yaml | 5 ++ responses/note/getCountNote.yaml | 7 ++ responses/note/noteCreee.yaml | 6 +- responses/note/noteSupprimee.yaml | 2 +- responses/note/updateNote.yaml | 6 +- 17 files changed, 160 insertions(+), 126 deletions(-) delete mode 100644 paths/note/noteById.yaml rename paths/note/{notesAuteur.yaml => notesIdAuteur.yaml} (55%) create mode 100644 paths/note/notesIdAuteurCount.yaml create mode 100644 paths/note/notesIdNote.yaml delete mode 100644 paths/note/notesParCollaborateur.yaml delete mode 100644 paths/note/nouvelleNote.yaml delete mode 100644 paths/note/supprimerNote.yaml delete mode 100644 paths/note/updateNote.yaml create mode 100644 responses/erreur/unsupportedMediaType.yaml create mode 100644 responses/note/getCountNote.yaml diff --git a/openapi.yaml b/openapi.yaml index 6e73a85..4f501a8 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -31,28 +31,22 @@ paths: #Note /notes/: $ref: ./paths/note/notes.yaml - /notes/nouvellenote: - $ref: ./paths/note/nouvelleNote.yaml /notes/{idNote}: - $ref: ./paths/note/noteById.yaml - /notes/{idNote}/updateNote: - $ref: ./paths/note/updateNote.yaml - /notes/auteur/{idReferent}: - $ref: ./paths/note/notesAuteur.yaml - /notes/auteur/{idReferent}/collaborateur/{idCollaborateur}: - $ref: ./paths/note/notesParCollaborateur.yaml - /notes/{idNote}/supprimer: - $ref: ./paths/note/supprimerNote.yaml + $ref: ./paths/note/notesIdNote.yaml + /notes/{idAuteur}: + $ref: ./paths/note/notesIdAuteur.yaml + /notes/{idAuteur}/count: + $ref: ./paths/note/notesIdAuteurCount.yaml #Referent - /referents: - $ref: ./paths/referents/referents.yaml - /referents/{idReferent}: - $ref: ./paths/referents/referentById.yaml - /referents/collaborateur/{idCollaborateur}: - $ref: ./paths/referents/referentsByCollaborateur.yaml - /referents/actuel/collaborateur/{idCollaborateur}: - $ref: ./paths/referents/referentActuelByCollaborateur.yaml + #/referents: + #$ref: ./paths/referents/referents.yaml + #/referents/{idReferent}: + #$ref: ./paths/referents/referentById.yaml + #/referents/collaborateur/{idCollaborateur}: + #$ref: ./paths/referents/referentsByCollaborateur.yaml + #/referents/actuel/collaborateur/{idCollaborateur}: + #$ref: ./paths/referents/referentActuelByCollaborateur.yaml #EP /ep: diff --git a/parameters/path/idAuteur.yaml b/parameters/path/idAuteur.yaml index 9bfe72b..c280ca4 100644 --- a/parameters/path/idAuteur.yaml +++ b/parameters/path/idAuteur.yaml @@ -4,4 +4,4 @@ schema: type: string format: uuid required: true -description: id de l'auteur \ No newline at end of file +description: Id de l'auteur \ No newline at end of file diff --git a/paths/note/noteById.yaml b/paths/note/noteById.yaml deleted file mode 100644 index 2b8931a..0000000 --- a/paths/note/noteById.yaml +++ /dev/null @@ -1,16 +0,0 @@ -get: - tags: - - notes - operationId: getNoteById - description: Récupérer une note par son id - parameters: - - $ref: ../../parameters/path/idNote.yaml - responses: - '200': - $ref: ../../responses/note/getNote.yaml - - '403': - $ref: ../../responses/erreur/forbidden.yaml - - '404': - $ref: ../../responses/erreur/notFound.yaml \ No newline at end of file diff --git a/paths/note/notes.yaml b/paths/note/notes.yaml index 94f8598..ccdb271 100644 --- a/paths/note/notes.yaml +++ b/paths/note/notes.yaml @@ -1,16 +1,22 @@ -get: +post: tags: - notes - operationId: getNotes - description: Récupérer toutes les notes - parameters: - - $ref: ../../parameters/query/asc.yaml - - $ref: ../../parameters/query/numPage.yaml - - $ref: ../../parameters/query/parPage.yaml - - $ref: ../../parameters/query/texte.yaml - - $ref: ../../parameters/query/tri.yaml + operationId: addNote + description: Créer une nouvelle note. + requestBody: + $ref: ../../requestbodies/note.yaml responses: - '200': - $ref: ../../responses/note/getListeNotes.yaml + '201': + $ref: ../../responses/note/noteCreee.yaml + + '401': + $ref: ../../responses/erreur/unauthorized.yaml + '403': - $ref: ../../responses/erreur/forbidden.yaml \ No newline at end of file + $ref: ../../responses/erreur/forbidden.yaml + + '415': + $ref: ../../responses/erreur/unsupportedMediaType.yaml + + '500': + $ref: ../../responses/erreur/internalServerError.yaml \ No newline at end of file diff --git a/paths/note/notesAuteur.yaml b/paths/note/notesIdAuteur.yaml similarity index 55% rename from paths/note/notesAuteur.yaml rename to paths/note/notesIdAuteur.yaml index 87db0fb..f278e3c 100644 --- a/paths/note/notesAuteur.yaml +++ b/paths/note/notesIdAuteur.yaml @@ -1,21 +1,27 @@ get: tags: - notes - operationId: getNotesByAuteur - description: Récupérer les notes d'une personne a écrite + operationId: getNotesAuteur + description: Récupérer les notes d’un auteur. parameters: + - $ref: ../../parameters/path/idAuteur.yaml - $ref: ../../parameters/query/asc.yaml - - $ref: ../../parameters/path/idReferent.yaml - $ref: ../../parameters/query/numPage.yaml - $ref: ../../parameters/query/parPage.yaml - $ref: ../../parameters/query/texte.yaml - $ref: ../../parameters/query/tri.yaml responses: - '200': + '200': $ref: ../../responses/note/getListeNotes.yaml - + + '401': + $ref: ../../responses/erreur/unauthorized.yaml + '403': $ref: ../../responses/erreur/forbidden.yaml '404': - $ref: ../../responses/erreur/notFound.yaml \ No newline at end of file + $ref: ../../responses/erreur/notFound.yaml + + '500': + $ref: ../../responses/erreur/internalServerError.yaml \ No newline at end of file diff --git a/paths/note/notesIdAuteurCount.yaml b/paths/note/notesIdAuteurCount.yaml new file mode 100644 index 0000000..f849c65 --- /dev/null +++ b/paths/note/notesIdAuteurCount.yaml @@ -0,0 +1,27 @@ +get: + tags: + - notes + operationId: getNotesAuteurCount + description: Récupérer le nombre total de notes d’un auteur. + parameters: + - $ref: ../../parameters/path/idAuteur.yaml + - $ref: ../../parameters/query/asc.yaml + - $ref: ../../parameters/query/numPage.yaml + - $ref: ../../parameters/query/parPage.yaml + - $ref: ../../parameters/query/texte.yaml + - $ref: ../../parameters/query/tri.yaml + responses: + '200': + $ref: ../../responses/note/getCountNote.yaml + + '401': + $ref: ../../responses/erreur/unauthorized.yaml + + '403': + $ref: ../../responses/erreur/forbidden.yaml + + '404': + $ref: ../../responses/erreur/notFound.yaml + + '500': + $ref: ../../responses/erreur/internalServerError.yaml \ No newline at end of file diff --git a/paths/note/notesIdNote.yaml b/paths/note/notesIdNote.yaml new file mode 100644 index 0000000..64254e7 --- /dev/null +++ b/paths/note/notesIdNote.yaml @@ -0,0 +1,65 @@ +get: + tags: + - notes + operationId: getNoteById + description: Récupérer une note par son id. + parameters: + - $ref: ../../parameters/path/idNote.yaml + responses: + '200': + $ref: ../../responses/note/getNote.yaml + + '401': + $ref: ../../responses/erreur/unauthorized.yaml + + '403': + $ref: ../../responses/erreur/forbidden.yaml + + '404': + $ref: ../../responses/erreur/notFound.yaml + + '500': + $ref: ../../responses/erreur/internalServerError.yaml +put: + tags: + - notes + operationId: updateNote + description: Modifier une note. + parameters: + - $ref: ../../parameters/path/idNote.yaml + requestBody: + $ref: ../../requestbodies/note.yaml + responses: + '200': + $ref: ../../responses/note/updateNote.yaml + + '401': + $ref: ../../responses/erreur/unauthorized.yaml + + '403': + $ref: ../../responses/erreur/forbidden.yaml + + '404': + $ref: ../../responses/erreur/notFound.yaml + + '415': + $ref: ../../responses/erreur/unsupportedMediaType.yaml + + '500': + $ref: ../../responses/erreur/internalServerError.yaml +delete: + tags: + - notes + operationId: deleteNote + description: Supprimer une note + parameters: + - $ref: ../../parameters/path/idNote.yaml + responses: + '204': + $ref: ../../responses/note/noteSupprimee.yaml + + '403': + $ref: ../../responses/erreur/forbidden.yaml + + '404': + $ref: ../../responses/erreur/notFound.yaml \ No newline at end of file diff --git a/paths/note/notesParCollaborateur.yaml b/paths/note/notesParCollaborateur.yaml deleted file mode 100644 index d748e96..0000000 --- a/paths/note/notesParCollaborateur.yaml +++ /dev/null @@ -1,22 +0,0 @@ -get: - tags: - - notes - operationId: getNotesByCollaborateur - description: Récupérer une note par son id - parameters: - - $ref: ../../parameters/query/asc.yaml - - $ref: ../../parameters/path/idCollaborateur.yaml - - $ref: ../../parameters/path/idReferent.yaml - - $ref: ../../parameters/query/numPage.yaml - - $ref: ../../parameters/query/parPage.yaml - - $ref: ../../parameters/query/texte.yaml - - $ref: ../../parameters/query/tri.yaml - responses: - '200': - $ref: ../../responses/note/getListeNotes.yaml - - '403': - $ref: ../../responses/erreur/forbidden.yaml - - '404': - $ref: ../../responses/erreur/notFound.yaml \ No newline at end of file diff --git a/paths/note/nouvelleNote.yaml b/paths/note/nouvelleNote.yaml deleted file mode 100644 index e8edce0..0000000 --- a/paths/note/nouvelleNote.yaml +++ /dev/null @@ -1,12 +0,0 @@ -post: - tags: - - notes - operationId: nouvelleNote - description: Ajouter une nouvelle note - requestBody: - $ref: ../../requestbodies/note.yaml - responses: - '201': - $ref: ../../responses/note/noteCreee.yaml - '403': - $ref: ../../responses/erreur/forbidden.yaml \ No newline at end of file diff --git a/paths/note/supprimerNote.yaml b/paths/note/supprimerNote.yaml deleted file mode 100644 index 844c5e4..0000000 --- a/paths/note/supprimerNote.yaml +++ /dev/null @@ -1,16 +0,0 @@ -delete: - tags: - - notes - operationId: deleteNote - description: Supprimer une note - parameters: - - $ref: ../../parameters/path/idNote.yaml - responses: - '204': - $ref: ../../responses/note/noteSupprimee.yaml - - '403': - $ref: ../../responses/erreur/forbidden.yaml - - '404': - $ref: ../../responses/erreur/notFound.yaml \ No newline at end of file diff --git a/paths/note/updateNote.yaml b/paths/note/updateNote.yaml deleted file mode 100644 index c4f42b4..0000000 --- a/paths/note/updateNote.yaml +++ /dev/null @@ -1,18 +0,0 @@ -put: - tags: - - notes - operationId: updateNote - description: Mettre à jour une note - parameters: - - $ref: ../../parameters/path/idNote.yaml - requestBody: - $ref: ../../requestbodies/note.yaml - responses: - '200': - $ref: ../../responses/note/updateNote.yaml - - '201': - $ref: ../../responses/note/noteCreee.yaml - - '403': - $ref: ../../responses/erreur/forbidden.yaml \ No newline at end of file diff --git a/responses/erreur/notfound.yaml b/responses/erreur/notfound.yaml index 1fe913a..04d0c1c 100644 --- a/responses/erreur/notfound.yaml +++ b/responses/erreur/notfound.yaml @@ -1,4 +1,4 @@ -description: Ressource n'a pas été trouvée +description: La ressource n'a pas été trouvée content: application/json: schema: diff --git a/responses/erreur/unsupportedMediaType.yaml b/responses/erreur/unsupportedMediaType.yaml new file mode 100644 index 0000000..78548db --- /dev/null +++ b/responses/erreur/unsupportedMediaType.yaml @@ -0,0 +1,5 @@ +description: L’opération ne peut pas être effectuée car certaines données sont manquantes +content: + application/json: + schema: + $ref: ../../schemas/erreur/erreur.yaml \ No newline at end of file diff --git a/responses/note/getCountNote.yaml b/responses/note/getCountNote.yaml new file mode 100644 index 0000000..4b6e44d --- /dev/null +++ b/responses/note/getCountNote.yaml @@ -0,0 +1,7 @@ +description: OK +content: + application/json: + schema: + type: integer + format: int64 + description: Nombre total de notes \ No newline at end of file diff --git a/responses/note/noteCreee.yaml b/responses/note/noteCreee.yaml index fc8f9e9..e478a52 100644 --- a/responses/note/noteCreee.yaml +++ b/responses/note/noteCreee.yaml @@ -1 +1,5 @@ -description: Note créée avec succès \ No newline at end of file +description: Note créée avec succès +content: + application/json: + schema: + $ref: ../../schemas/note/detailsNote.yaml \ No newline at end of file diff --git a/responses/note/noteSupprimee.yaml b/responses/note/noteSupprimee.yaml index dc4beb2..2dbef8d 100644 --- a/responses/note/noteSupprimee.yaml +++ b/responses/note/noteSupprimee.yaml @@ -1 +1 @@ -description: Note supprimée \ No newline at end of file +description: Note supprimée avec succès \ No newline at end of file diff --git a/responses/note/updateNote.yaml b/responses/note/updateNote.yaml index 4d00a18..bec0a25 100644 --- a/responses/note/updateNote.yaml +++ b/responses/note/updateNote.yaml @@ -1 +1,5 @@ -description: Note mise à jour avec succès \ No newline at end of file +description: Note modifiée avec succès +content: + application/json: + schema: + $ref: ../../schemas/note/detailsNote.yaml \ No newline at end of file