PetController.php 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <?php
  2. namespace PetstoreIO;
  3. final class PetController
  4. {
  5. /**
  6. * @OA\Get(
  7. * path="/pet/findByTags",
  8. * summary="Finds Pets by tags",
  9. * tags={"pet"},
  10. * description="Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
  11. * operationId="findPetsByTags",
  12. * @OA\Parameter(
  13. * name="tags",
  14. * in="query",
  15. * description="Tags to filter by",
  16. * required=true,
  17. * @OA\Schema(
  18. * type="array",
  19. * @OA\Items(type="string"),
  20. * ),
  21. * style="form"
  22. * ),
  23. * @OA\Response(
  24. * response=200,
  25. * description="successful operation",
  26. * @OA\Schema(
  27. * type="array",
  28. * @OA\Items(ref="#/components/schemas/Pet")
  29. * ),
  30. * ),
  31. * @OA\Response(
  32. * response="400",
  33. * description="Invalid tag value",
  34. * ),
  35. * security={
  36. * {"petstore_auth": {"write:pets", "read:pets"}}
  37. * },
  38. * deprecated=true
  39. * )
  40. */
  41. public function findByTags()
  42. {
  43. }
  44. /**
  45. * @OA\Get(
  46. * path="/pet/findByStatus",
  47. * summary="Finds Pets by status",
  48. * description="Multiple status values can be provided with comma separated strings",
  49. * operationId="findPetsByStatus",
  50. * tags={"pet"},
  51. * @OA\Parameter(
  52. * name="status",
  53. * in="query",
  54. * description="Status values that need to be considered for filter",
  55. * required=true,
  56. * @OA\Schema(
  57. * type="array",
  58. * @OA\Items(
  59. * type="string",
  60. * enum={"available", "pending", "sold"},
  61. * default="available"
  62. * ),
  63. * ),
  64. * style="form"
  65. * ),
  66. * @OA\Response(
  67. * response=200,
  68. * description="successful operation",
  69. * @OA\JsonContent(
  70. * type="array",
  71. * @OA\Items(ref="#/components/schemas/Pet")
  72. * )
  73. * ),
  74. * @OA\Response(
  75. * response="400",
  76. * description="Invalid status value",
  77. * ),
  78. * security={
  79. * {"petstore_auth": {"write:pets", "read:pets"}}
  80. * }
  81. * )
  82. */
  83. public function findByStatus()
  84. {
  85. }
  86. /**
  87. * @OA\Get(
  88. * path="/pet/{petId}",
  89. * summary="Find pet by ID",
  90. * description="Returns a single pet",
  91. * operationId="getPetById",
  92. * tags={"pet"},
  93. * @OA\Parameter(
  94. * description="ID of pet to return",
  95. * in="path",
  96. * name="petId",
  97. * required=true,
  98. * @OA\Schema(
  99. * type="integer",
  100. * format="int64"
  101. * )
  102. * ),
  103. * @OA\Response(
  104. * response=200,
  105. * description="successful operation",
  106. * @OA\JsonContent(ref="#/components/schemas/Pet")
  107. * ),
  108. * @OA\Response(
  109. * response="400",
  110. * description="Invalid ID supplied"
  111. * ),
  112. * @OA\Response(
  113. * response="404",
  114. * description="Pet not found"
  115. * ),
  116. * security={
  117. * {"api_key": {}}
  118. * }
  119. * )
  120. */
  121. public function getPetById()
  122. {
  123. }
  124. /**
  125. * @OA\Post(
  126. * path="/pet",
  127. * tags={"pet"},
  128. * operationId="addPet",
  129. * summary="Add a new pet to the store",
  130. * description="",
  131. * @OA\RequestBody(
  132. * description="Pet object that needs to be added to the store",
  133. * required=true,
  134. * @OA\JsonContent(ref="#/components/schemas/Pet"),
  135. * @OA\MediaType(
  136. * mediaType="application/xml",
  137. * @OA\Schema(ref="#/components/schemas/Pet")
  138. * ),
  139. * ),
  140. * @OA\RequestBody(
  141. * description="Pet object that needs to be added to the store",
  142. * required=true,
  143. * @OA\MediaType(
  144. * mediaType="application/xml",
  145. * @OA\Schema(ref="#/components/schemas/Pet")
  146. * )
  147. * ),
  148. * @OA\Response(
  149. * response=405,
  150. * description="Invalid input",
  151. * ),
  152. * security={{"petstore_auth":{"write:pets", "read:pets"}}}
  153. * )
  154. */
  155. public function addPet()
  156. {
  157. }
  158. /**
  159. * @OA\Put(
  160. * path="/pet",
  161. * tags={"pet"},
  162. * operationId="updatePet",
  163. * summary="Update an existing pet",
  164. * description="",
  165. * @OA\RequestBody(
  166. * required=true,
  167. * description="Pet object that needs to be added to the store",
  168. * @OA\JsonContent(ref="#/components/schemas/Pet"),
  169. * @OA\MediaType(
  170. * mediaType="application/xml",
  171. * @OA\Schema(ref="#/components/schemas/Pet"),
  172. * )
  173. * ),
  174. * @OA\Response(
  175. * response=400,
  176. * description="Invalid ID supplied",
  177. * ),
  178. * @OA\Response(
  179. * response=404,
  180. * description="Pet not found",
  181. * ),
  182. * @OA\Response(
  183. * response=405,
  184. * description="Validation exception",
  185. * ),
  186. * security={{"petstore_auth":{"write:pets", "read:pets"}}}
  187. * )
  188. */
  189. public function updatePet()
  190. {
  191. }
  192. /**
  193. * @OA\Delete(
  194. * path="/pet/{petId}",
  195. * summary="Deletes a pet",
  196. * description="",
  197. * operationId="deletePet",
  198. * tags={"pet"},
  199. * @OA\Parameter(
  200. * description="Pet id to delete",
  201. * in="path",
  202. * name="petId",
  203. * required=true,
  204. * @OA\Schema(
  205. * type="integer",
  206. * format="int64"
  207. * )
  208. * ),
  209. * @OA\Header(
  210. * header="api_key",
  211. * description="Api key header",
  212. * required=false,
  213. * @OA\Schema(
  214. * type="string"
  215. * )
  216. * ),
  217. * @OA\Response(
  218. * response=400,
  219. * description="Invalid ID supplied"
  220. * ),
  221. * @OA\Response(
  222. * response=404,
  223. * description="Pet not found"
  224. * ),
  225. * security={{"petstore_auth":{"write:pets", "read:pets"}}}
  226. * )
  227. */
  228. public function deletePet()
  229. {
  230. }
  231. /**
  232. * @OA\Post(
  233. * path="/pet/{petId}",
  234. * tags={"pet"},
  235. * summary="Updates a pet in the store with form data",
  236. * description="",
  237. * operationId="updatePetWithForm",
  238. * @OA\RequestBody(
  239. * required=false,
  240. * @OA\MediaType(
  241. * mediaType="application/x-www-form-urlencoded",
  242. * @OA\Schema(
  243. * type="object",
  244. * @OA\Property(
  245. * property="name",
  246. * description="Updated name of the pet",
  247. * type="string"
  248. * ),
  249. * @OA\Property(
  250. * property="status",
  251. * description="Updated status of the pet",
  252. * type="string"
  253. * ),
  254. * )
  255. * )
  256. * ),
  257. * @OA\Parameter(
  258. * name="petId",
  259. * in="path",
  260. * description="ID of pet that needs to be updated",
  261. * required=true,
  262. * @OA\Schema(
  263. * type="integer",
  264. * format="int64"
  265. * )
  266. * ),
  267. * @OA\Response(response="405",description="Invalid input"),
  268. * security={{
  269. * "petstore_auth": {"write:pets", "read:pets"}
  270. * }}
  271. * )
  272. */
  273. public function updatePetWithForm()
  274. {
  275. }
  276. /**
  277. * @OA\Post(
  278. * path="/pet/{petId}/uploadImage",
  279. * description="",
  280. * summary="uploads an image",
  281. * operationId="uploadFile",
  282. * @OA\RequestBody(
  283. * required=true,
  284. * @OA\MediaType(
  285. * mediaType="multipart/form-data",
  286. * @OA\Schema(
  287. * @OA\Property(
  288. * description="Additional data to pass to server",
  289. * property="additionalMetadata",
  290. * type="string"
  291. * ),
  292. * @OA\Property(
  293. * description="file to upload",
  294. * property="file",
  295. * type="string",
  296. * format="file",
  297. * ),
  298. * required={"file"}
  299. * )
  300. * )
  301. * ),
  302. * @OA\Parameter(
  303. * description="ID of pet to update",
  304. * in="path",
  305. * name="petId",
  306. * required=true,
  307. * @OA\Schema(
  308. * type="integer",
  309. * format="int64"
  310. * ),
  311. * ),
  312. * @OA\Response(
  313. * response="200",
  314. * description="successful operation",
  315. * @OA\Schema(ref="#/components/schemas/ApiResponse")
  316. * ),
  317. * security={
  318. * {
  319. * "petstore_auth": {
  320. * "read:pets",
  321. * "write:pets"
  322. * }
  323. * }
  324. * },
  325. * tags={
  326. * "pet"
  327. * }
  328. * )
  329. * */
  330. public function uploadFile()
  331. {
  332. }
  333. }