Advertisement
Guest User

Untitled

a guest
May 13th, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3. description: "API permettant la gestion et la réservation de produits sous différentes formes, via des menus, des commandes. La mise en avant des produits ainsi que des promotions sont possible via celle-ci."
  4. version: "1.0.0"
  5. title: "Burger API - Groupe 2"
  6. license:
  7. name: "NodeJS"
  8. url: "https://github.com/nodejs/node/blob/master/LICENSE"
  9. host: "vincentguenin.ddns.net:8000"
  10. basePath: "/"
  11. tags:
  12. - name: "product"
  13. description: "Manipuler les produits"
  14. - name: "menu"
  15. description: "Manipuler les menus"
  16. - name: "command"
  17. description: "Tout concernant les commandes"
  18. - name: "promotion"
  19. description: "Mettez vos produits et menus en avant"
  20. - name: "user"
  21. description: "Gérer vos utilisateurs"
  22. schemes:
  23. - "http"
  24. paths:
  25. /product:
  26. put:
  27. tags:
  28. - "product"
  29. summary: "Ajouter un nouveau produit"
  30. description: ""
  31. operationId: "addProduct"
  32. consumes:
  33. - "application/json"
  34. produces:
  35. - "application/json"
  36. parameters:
  37. - in: "header"
  38. name: "x-access-token"
  39. description: "Token d'accès de l'utilisateur"
  40. required: true
  41. - in: "body"
  42. name: "body"
  43. description: "Produit à ajouter en base"
  44. required: true
  45. schema:
  46. $ref: '#/definitions/Product'
  47. responses:
  48. 201:
  49. description: "Succès de l'opération"
  50. schema:
  51. $ref: '#/definitions/Product'
  52. 400:
  53. description: "Paramètres invalides"
  54. 500:
  55. description: "Erreur technique du serveur"
  56. /product/modifyName/{oldName}/{newName}:
  57. put:
  58. tags:
  59. - "product"
  60. summary: "Modifier le nom d'un produit"
  61. description: ""
  62. operationId: "ModifyProductName"
  63. consumes:
  64. - "application/json"
  65. produces:
  66. - "application/json"
  67. parameters:
  68. - in: "header"
  69. name: "x-access-token"
  70. description: "Produit à ajouter en base"
  71. required: true
  72. schema:
  73. example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJlbWFpbEBnbWFpbC5jb20iLCJ1c2VybmFtZSI6IlVzZXIxIiwiaWF0IjoxNTI2MjI0Nzg2LCJleHAiOjE1MjYzMTExODZ9.K9YlKCAYfVLtESwV0sTYEo6Ckrs0a8D8uznnJyorbhE"
  74. - in: "path"
  75. name: "oldName"
  76. type: "string"
  77. description: "Ancien nom du produit"
  78. required: true
  79. - in: "path"
  80. name: "newName"
  81. type: "string"
  82. description: "Nouveau nom du produit"
  83. required: true
  84. responses:
  85. 201:
  86. description: "Succès de l'opération"
  87. schema:
  88. $ref: '#/definitions/Product'
  89. 400:
  90. description: "Paramètres invalides"
  91. 500:
  92. description: "Erreur technique du serveur"
  93.  
  94.  
  95.  
  96. definitions:
  97. Product:
  98. type: "object"
  99. properties:
  100. id:
  101. type: "integer"
  102. format: "int64"
  103. name:
  104. type: "string"
  105. cal:
  106. type: "integer"
  107. format: "int64"
  108. description: "Nombre de calories du produit"
  109. highlight:
  110. type: "boolean"
  111. default: false
  112. price:
  113. type: "number"
  114. format: "double"
  115. size:
  116. type: "string"
  117. maxLength: 255
  118. Menu:
  119. type: "object"
  120. properties:
  121. id:
  122. type: "integer"
  123. format: "int64"
  124. name:
  125. type: "string"
  126. price:
  127. type: "number"
  128. format: "double"
  129. size:
  130. type: "string"
  131. maxLength: 255
  132. Command:
  133. type: "object"
  134. properties:
  135. id:
  136. type: "integer"
  137. format: "int64"
  138. status:
  139. type: "string"
  140. price:
  141. type: "number"
  142. format: "double"
  143. Promotion:
  144. type: "object"
  145. properties:
  146. id:
  147. type: "integer"
  148. format: "int64"
  149. price:
  150. type: "number"
  151. format: "double"
  152. startDate:
  153. type: "string"
  154. format: "date"
  155. endDate:
  156. type: "string"
  157. format: "date"
  158. User:
  159. type: "object"
  160. properties:
  161. id:
  162. type: "integer"
  163. format: "int64"
  164. email:
  165. type: "string"
  166. username:
  167. type: "string"
  168. password:
  169. type: "string"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement