From 50188d95d478cc0a3a3e65ca1b3a3d357b4c35f8 Mon Sep 17 00:00:00 2001 From: "art.dambrine" Date: Wed, 25 Mar 2020 16:30:36 +0000 Subject: [PATCH] final doc swagger --- docs/swagger.json | 331 +++++++++++++++++++++++----------------------- 1 file changed, 164 insertions(+), 167 deletions(-) diff --git a/docs/swagger.json b/docs/swagger.json index 790b64d..5d789ac 100755 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1,232 +1,220 @@ { "swagger": "2.0", "info": { - "description": "Bienvenue pour tester ma nouvelle api de sauvegarde des etudiants. http://localhost:3000", + "description": "Bienvenue pour tester ma nouvelle api de sauvegarde des etudiants. http://localhost:3000
Pour voir la collection etudiant aller à http://localhost:3000/api/etudiants", "version": "1.0.0", "title": "Documentation API - Etudiants", "contact": { "email": "art-dambrine@live.fr" } }, - "host": "localhost", + "host": "localhost:3000", "basePath": "/api", "tags": [ { - "name": "pet", - "description": "Everything about your Pets" + "name": "etudiant", + "description": "Everything about your etudiants" } ], "schemes": [ "http" ], "paths": { - "/pet": { + "/etudiants": { "post": { "tags": [ - "pet" + "etudiant" ], - "summary": "Add a new pet to the store", + "summary": "Ajoute un nouvel etudiant à la collection", "description": "", - "operationId": "addPet", + "operationId": "addetudiant", "consumes": [ - "application/json", - "application/xml" - ], - "produces": [ - "application/xml", "application/json" ], - "parameters": [ - { - "in": "body", - "name": "body", - "description": "Pet object that needs to be added to the store", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - } - } - ], - "responses": { - "405": { - "description": "Invalid input" - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ] - }, - "put": { - "tags": [ - "pet" - ], - "summary": "Update an existing pet", - "description": "", - "operationId": "updatePet", - "consumes": [ - "application/json", - "application/xml" - ], "produces": [ - "application/xml", "application/json" ], "parameters": [ { "in": "body", "name": "body", - "description": "Pet object that needs to be added to the store", + "description": "etudiant object that needs to be added to the store", "required": true, "schema": { - "$ref": "#/definitions/Pet" + "$ref": "#/definitions/etudiant" } } ], "responses": { - "400": { - "description": "Invalid ID supplied" - }, - "404": { - "description": "Pet not found" - }, "405": { - "description": "Validation exception" - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] + "description": "Invalid input" } - ] + } } }, - "/pet/{petId}": { + "/etudiants/{etudiantId}": { "get": { "tags": [ - "pet" + "etudiant" ], - "summary": "Find pet by ID", - "description": "Returns a single pet", - "operationId": "getPetById", + "summary": "Retrouve un etudiant par ID", + "description": "Retourne un seul etudiant", + "operationId": "getetudiantById", "produces": [ - "application/xml", "application/json" ], "parameters": [ { - "name": "petId", + "name": "etudiantId", "in": "path", - "description": "ID of pet to return", + "description": "ID of etudiant to return", "required": true, - "type": "integer", - "format": "int64" + "type": "string" } ], "responses": { "200": { "description": "successful operation", "schema": { - "$ref": "#/definitions/Pet" + "$ref": "#/definitions/etudiant" } }, "400": { "description": "Invalid ID supplied" }, "404": { - "description": "Pet not found" + "description": "etudiant not found" } - }, - "security": [ - { - "api_key": [] - } - ] + } }, - "post": { + "put": { "tags": [ - "pet" + "etudiant" ], - "summary": "Updates a pet in the store with form data", + "summary": "Update un etudiant dans la collection avec les données du formulaire", "description": "", - "operationId": "updatePetWithForm", + "operationId": "updateetudiantWithForm", "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ - "application/xml", "application/json" ], "parameters": [ { - "name": "petId", + "name": "etudiantId", "in": "path", - "description": "ID of pet that needs to be updated", + "description": "ID de l'etudiant qui doit être update", "required": true, - "type": "integer", - "format": "int64" + "type": "string" }, { - "name": "name", + "name": "numEtudiant", "in": "formData", - "description": "Updated name of the pet", - "required": false, + "description": "Updated name of the etudiant", + "required": true, "type": "string" }, { - "name": "status", + "name": "firstname", "in": "formData", - "description": "Updated status of the pet", - "required": false, + "description": "Updated status of the etudiant", + "required": true, + "type": "string" + }, + { + "name": "lastname", + "in": "formData", + "description": "Updated status of the etudiant", + "required": true, "type": "string" + }, + { + "name": "cycle", + "in": "formData", + "description": "Updated status of the etudiant", + "required": true, + "type": "number" + }, + { + "name": "adresse", + "in": "formData", + "description": "Updated status of the etudiant", + "required": false, + "type": "object", + "properties":{ + "num": { + "type": "number" + }, + "rue": { + "type": "string" + }, + "ville": { + "type": "string" + }, + "pays": { + "type": "string" + } + } + }, + { + "name": "email", + "in": "formData", + "description": "Updated status of the etudiant", + "required": false, + "type": "array", + "items": { + "type": "string" + } + }, + { + "name": "cours", + "in": "formData", + "description": "Updated status of the etudiant", + "required": false, + "type": "array", + "items": { + "type": "object", + "properties":{ + "code": { + "type": "string" + }, + "titre": { + "type": "string" + }, + "description": { + "type": "string" + }, + "credit": { + "type": "number" + } + } + } } ], "responses": { "405": { "description": "Invalid input" } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] - } - ] + } }, "delete": { "tags": [ - "pet" + "etudiant" ], - "summary": "Deletes a pet", + "summary": "Supprime un etudiant", "description": "", - "operationId": "deletePet", + "operationId": "deleteetudiant", "produces": [ - "application/xml", "application/json" ], "parameters": [ { - "name": "api_key", - "in": "header", - "required": false, - "type": "string" - }, - { - "name": "petId", + "name": "etudiantId", "in": "path", - "description": "Pet id to delete", + "description": "etudiant id to delete", "required": true, - "type": "integer", - "format": "int64" + "type": "string" } ], "responses": { @@ -234,71 +222,80 @@ "description": "Invalid ID supplied" }, "404": { - "description": "Pet not found" - } - }, - "security": [ - { - "petstore_auth": [ - "write:pets", - "read:pets" - ] + "description": "etudiant not found" } - ] + } } } }, "definitions": { - "Pet": { + "etudiant": { "type": "object", "required": [ - "name", - "photoUrls" + "numEtudiant", + "firstname", + "lastname", + "cycle" ], "properties": { - "id": { - "type": "integer", - "format": "int64" + "numEtudiant": { + "type": "string", + "example": "etu2020001" }, - "category": { - "$ref": "#/definitions/Category" + "firstname": { + "type": "string", + "example": "Arthur" }, - "name": { + "lastname": { "type": "string", - "example": "doggie" + "example": "Morgan" + }, + "cycle": { + "type": "number" + }, + "adresse": { + "type": "object", + "properties":{ + "num": { + "type": "number" + }, + "rue": { + "type": "string" + }, + "ville": { + "type": "string" + }, + "pays": { + "type": "string" + } + } }, - "photoUrls": { + "email": { "type": "array", - "xml": { - "name": "photoUrl", - "wrapped": true - }, "items": { "type": "string" } }, - "tags": { + "cours": { "type": "array", - "xml": { - "name": "tag", - "wrapped": true - }, "items": { - "$ref": "#/definitions/Tag" + "type": "object", + "properties":{ + "code": { + "type": "string" + }, + "titre": { + "type": "string" + }, + "description": { + "type": "string" + }, + "credit": { + "type": "number" + } + } } - }, - "status": { - "type": "string", - "description": "pet status in the store", - "enum": [ - "available", - "pending", - "sold" - ] } - }, - "xml": { - "name": "Pet" } } }