Browse Source

final doc swagger

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

331
docs/swagger.json

@ -1,232 +1,220 @@
{ {
"swagger": "2.0", "swagger": "2.0",
"info": { "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", "version": "1.0.0",
"title": "Documentation API - Etudiants", "title": "Documentation API - Etudiants",
"contact": { "contact": {
"email": "art-dambrine@live.fr" "email": "art-dambrine@live.fr"
} }
}, },
"host": "localhost", "host": "localhost:3000",
"basePath": "/api", "basePath": "/api",
"tags": [ "tags": [
{ {
"name": "pet", "name": "etudiant",
"description": "Everything about your Pets" "description": "Everything about your etudiants"
} }
], ],
"schemes": [ "schemes": [
"http" "http"
], ],
"paths": { "paths": {
"/pet": { "/etudiants": {
"post": { "post": {
"tags": [ "tags": [
"pet" "etudiant"
], ],
"summary": "Add a new pet to the store", "summary": "Ajoute un nouvel etudiant à la collection",
"description": "", "description": "",
"operationId": "addPet", "operationId": "addetudiant",
"consumes": [ "consumes": [
"application/json",
"application/xml"
],
"produces": [
"application/xml",
"application/json" "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": [ "produces": [
"application/xml",
"application/json" "application/json"
], ],
"parameters": [ "parameters": [
{ {
"in": "body", "in": "body",
"name": "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, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/Pet" "$ref": "#/definitions/etudiant"
} }
} }
], ],
"responses": { "responses": {
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Pet not found"
},
"405": { "405": {
"description": "Validation exception" "description": "Invalid input"
}
},
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
} }
] }
} }
}, },
"/pet/{petId}": { "/etudiants/{etudiantId}": {
"get": { "get": {
"tags": [ "tags": [
"pet" "etudiant"
], ],
"summary": "Find pet by ID", "summary": "Retrouve un etudiant par ID",
"description": "Returns a single pet", "description": "Retourne un seul etudiant",
"operationId": "getPetById", "operationId": "getetudiantById",
"produces": [ "produces": [
"application/xml",
"application/json" "application/json"
], ],
"parameters": [ "parameters": [
{ {
"name": "petId", "name": "etudiantId",
"in": "path", "in": "path",
"description": "ID of pet to return", "description": "ID of etudiant to return",
"required": true, "required": true,
"type": "integer", "type": "string"
"format": "int64"
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "successful operation", "description": "successful operation",
"schema": { "schema": {
"$ref": "#/definitions/Pet" "$ref": "#/definitions/etudiant"
} }
}, },
"400": { "400": {
"description": "Invalid ID supplied" "description": "Invalid ID supplied"
}, },
"404": { "404": {
"description": "Pet not found" "description": "etudiant not found"
} }
}, }
"security": [
{
"api_key": []
}
]
}, },
"post": { "put": {
"tags": [ "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": "", "description": "",
"operationId": "updatePetWithForm", "operationId": "updateetudiantWithForm",
"consumes": [ "consumes": [
"application/x-www-form-urlencoded" "application/x-www-form-urlencoded"
], ],
"produces": [ "produces": [
"application/xml",
"application/json" "application/json"
], ],
"parameters": [ "parameters": [
{ {
"name": "petId", "name": "etudiantId",
"in": "path", "in": "path",
"description": "ID of pet that needs to be updated", "description": "ID de l'etudiant qui doit être update",
"required": true, "required": true,
"type": "integer", "type": "string"
"format": "int64"
}, },
{ {
"name": "name", "name": "numEtudiant",
"in": "formData", "in": "formData",
"description": "Updated name of the pet", "description": "Updated name of the etudiant",
"required": false, "required": true,
"type": "string" "type": "string"
}, },
{ {
"name": "status", "name": "firstname",
"in": "formData", "in": "formData",
"description": "Updated status of the pet", "description": "Updated status of the etudiant",
"required": false, "required": true,
"type": "string"
},
{
"name": "lastname",
"in": "formData",
"description": "Updated status of the etudiant",
"required": true,
"type": "string" "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": { "responses": {
"405": { "405": {
"description": "Invalid input" "description": "Invalid input"
} }
}, }
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
]
}, },
"delete": { "delete": {
"tags": [ "tags": [
"pet" "etudiant"
], ],
"summary": "Deletes a pet", "summary": "Supprime un etudiant",
"description": "", "description": "",
"operationId": "deletePet", "operationId": "deleteetudiant",
"produces": [ "produces": [
"application/xml",
"application/json" "application/json"
], ],
"parameters": [ "parameters": [
{ {
"name": "api_key", "name": "etudiantId",
"in": "header",
"required": false,
"type": "string"
},
{
"name": "petId",
"in": "path", "in": "path",
"description": "Pet id to delete", "description": "etudiant id to delete",
"required": true, "required": true,
"type": "integer", "type": "string"
"format": "int64"
} }
], ],
"responses": { "responses": {
@ -234,71 +222,80 @@
"description": "Invalid ID supplied" "description": "Invalid ID supplied"
}, },
"404": { "404": {
"description": "Pet not found" "description": "etudiant not found"
}
},
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
} }
] }
} }
} }
}, },
"definitions": { "definitions": {
"Pet": { "etudiant": {
"type": "object", "type": "object",
"required": [ "required": [
"name", "numEtudiant",
"photoUrls" "firstname",
"lastname",
"cycle"
], ],
"properties": { "properties": {
"id": { "numEtudiant": {
"type": "integer", "type": "string",
"format": "int64" "example": "etu2020001"
}, },
"category": { "firstname": {
"$ref": "#/definitions/Category" "type": "string",
"example": "Arthur"
}, },
"name": { "lastname": {
"type": "string", "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", "type": "array",
"xml": {
"name": "photoUrl",
"wrapped": true
},
"items": { "items": {
"type": "string" "type": "string"
} }
}, },
"tags": { "cours": {
"type": "array", "type": "array",
"xml": {
"name": "tag",
"wrapped": true
},
"items": { "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"
} }
} }
} }

Loading…
Cancel
Save