Browse Source

final doc swagger

master
art.dambrine 5 years ago
parent
commit
50188d95d4
  1. 319
      docs/swagger.json

319
docs/swagger.json

@ -1,49 +1,47 @@
{
"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 <br> 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"
"application/json"
],
"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"
}
}
],
@ -51,182 +49,172 @@
"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",
"required": true,
"schema": {
"$ref": "#/definitions/Pet"
}
}
],
"responses": {
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Pet not found"
},
"405": {
"description": "Validation exception"
}
},
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
]
}
},
"/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": "string"
},
{
"name": "numEtudiant",
"in": "formData",
"description": "Updated name of the etudiant",
"required": true,
"type": "string"
},
{
"name": "firstname",
"in": "formData",
"description": "Updated status of the etudiant",
"required": true,
"type": "string"
},
{
"name": "lastname",
"in": "formData",
"description": "Updated status of the etudiant",
"required": true,
"type": "integer",
"format": "int64"
"type": "string"
},
{
"name": "name",
"name": "cycle",
"in": "formData",
"description": "Updated name of the pet",
"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": "status",
"name": "email",
"in": "formData",
"description": "Updated status of the pet",
"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"
"description": "etudiant not found"
}
},
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
]
}
}
},
"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"
},
"photoUrls": {
"type": "array",
"xml": {
"name": "photoUrl",
"wrapped": true
"cycle": {
"type": "number"
},
"items": {
"adresse": {
"type": "object",
"properties":{
"num": {
"type": "number"
},
"rue": {
"type": "string"
},
"ville": {
"type": "string"
},
"pays": {
"type": "string"
}
}
},
"tags": {
"email": {
"type": "array",
"xml": {
"name": "tag",
"wrapped": true
},
"items": {
"$ref": "#/definitions/Tag"
"type": "string"
}
},
"status": {
"type": "string",
"description": "pet status in the store",
"enum": [
"available",
"pending",
"sold"
]
}
"cours": {
"type": "array",
"items": {
"type": "object",
"properties":{
"code": {
"type": "string"
},
"xml": {
"name": "Pet"
"titre": {
"type": "string"
},
"description": {
"type": "string"
},
"credit": {
"type": "number"
}
}
}
}
}
}
}

Loading…
Cancel
Save