Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

1043 lignes
28 KiB

  1. {
  2. "swagger":"2.0",
  3. "info":{
  4. "description":"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
  5. "version":"1.0.0",
  6. "title":"Swagger Petstore",
  7. "termsOfService":"http://swagger.io/terms/",
  8. "contact":{
  9. "email":"apiteam@swagger.io"
  10. },
  11. "license":{
  12. "name":"Apache 2.0",
  13. "url":"http://www.apache.org/licenses/LICENSE-2.0.html"
  14. }
  15. },
  16. "host":"localhost:3204",
  17. "basePath":"/",
  18. "tags":[
  19. {
  20. "name":"pet",
  21. "description":"Everything about your Pets",
  22. "externalDocs":{
  23. "description":"Find out more",
  24. "url":"http://swagger.io"
  25. }
  26. },
  27. {
  28. "name":"store",
  29. "description":"Access to Petstore orders"
  30. },
  31. {
  32. "name":"user",
  33. "description":"Operations about user",
  34. "externalDocs":{
  35. "description":"Find out more about our store",
  36. "url":"http://swagger.io"
  37. }
  38. }
  39. ],
  40. "schemes":[
  41. "http"
  42. ],
  43. "paths":{
  44. "/pet":{
  45. "post":{
  46. "tags":[
  47. "pet"
  48. ],
  49. "summary":"Add a new pet to the store",
  50. "description":"",
  51. "operationId":"addPet",
  52. "consumes":[
  53. "application/json",
  54. "application/xml"
  55. ],
  56. "produces":[
  57. "application/xml",
  58. "application/json"
  59. ],
  60. "parameters":[
  61. {
  62. "in":"body",
  63. "name":"body",
  64. "description":"Pet object that needs to be added to the store",
  65. "required":true,
  66. "schema":{
  67. "$ref":"#/definitions/Pet"
  68. }
  69. }
  70. ],
  71. "responses":{
  72. "405":{
  73. "description":"Invalid input"
  74. }
  75. },
  76. "security":[
  77. {
  78. "petstore_auth":[
  79. "write:pets",
  80. "read:pets"
  81. ]
  82. }
  83. ]
  84. },
  85. "put":{
  86. "tags":[
  87. "pet"
  88. ],
  89. "summary":"Update an existing pet",
  90. "description":"",
  91. "operationId":"updatePet",
  92. "consumes":[
  93. "application/json",
  94. "application/xml"
  95. ],
  96. "produces":[
  97. "application/xml",
  98. "application/json"
  99. ],
  100. "parameters":[
  101. {
  102. "in":"body",
  103. "name":"body",
  104. "description":"Pet object that needs to be added to the store",
  105. "required":true,
  106. "schema":{
  107. "$ref":"#/definitions/Pet"
  108. }
  109. }
  110. ],
  111. "responses":{
  112. "400":{
  113. "description":"Invalid ID supplied"
  114. },
  115. "404":{
  116. "description":"Pet not found"
  117. },
  118. "405":{
  119. "description":"Validation exception"
  120. }
  121. },
  122. "security":[
  123. {
  124. "petstore_auth":[
  125. "write:pets",
  126. "read:pets"
  127. ]
  128. }
  129. ]
  130. }
  131. },
  132. "/pet/findByStatus":{
  133. "get":{
  134. "tags":[
  135. "pet"
  136. ],
  137. "summary":"Finds Pets by status",
  138. "description":"Multiple status values can be provided with comma separated strings",
  139. "operationId":"findPetsByStatus",
  140. "produces":[
  141. "application/xml",
  142. "application/json"
  143. ],
  144. "parameters":[
  145. {
  146. "name":"status",
  147. "in":"query",
  148. "description":"Status values that need to be considered for filter",
  149. "required":true,
  150. "type":"array",
  151. "items":{
  152. "type":"string",
  153. "enum":[
  154. "available",
  155. "pending",
  156. "sold"
  157. ],
  158. "default":"available"
  159. },
  160. "collectionFormat":"multi"
  161. }
  162. ],
  163. "responses":{
  164. "200":{
  165. "description":"successful operation",
  166. "schema":{
  167. "type":"array",
  168. "items":{
  169. "$ref":"#/definitions/Pet"
  170. }
  171. }
  172. },
  173. "400":{
  174. "description":"Invalid status value"
  175. }
  176. },
  177. "security":[
  178. {
  179. "petstore_auth":[
  180. "write:pets",
  181. "read:pets"
  182. ]
  183. }
  184. ]
  185. }
  186. },
  187. "/pet/findByTags":{
  188. "get":{
  189. "tags":[
  190. "pet"
  191. ],
  192. "summary":"Finds Pets by tags",
  193. "description":"Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
  194. "operationId":"findPetsByTags",
  195. "produces":[
  196. "application/xml",
  197. "application/json"
  198. ],
  199. "parameters":[
  200. {
  201. "name":"tags",
  202. "in":"query",
  203. "description":"Tags to filter by",
  204. "required":true,
  205. "type":"array",
  206. "items":{
  207. "type":"string"
  208. },
  209. "collectionFormat":"multi"
  210. }
  211. ],
  212. "responses":{
  213. "200":{
  214. "description":"successful operation",
  215. "schema":{
  216. "type":"array",
  217. "items":{
  218. "$ref":"#/definitions/Pet"
  219. }
  220. }
  221. },
  222. "400":{
  223. "description":"Invalid tag value"
  224. }
  225. },
  226. "security":[
  227. {
  228. "petstore_auth":[
  229. "write:pets",
  230. "read:pets"
  231. ]
  232. }
  233. ],
  234. "deprecated":true
  235. }
  236. },
  237. "/pet/{petId}":{
  238. "get":{
  239. "tags":[
  240. "pet"
  241. ],
  242. "summary":"Find pet by ID",
  243. "description":"Returns a single pet",
  244. "operationId":"getPetById",
  245. "produces":[
  246. "application/xml",
  247. "application/json"
  248. ],
  249. "parameters":[
  250. {
  251. "name":"petId",
  252. "in":"path",
  253. "description":"ID of pet to return",
  254. "required":true,
  255. "type":"integer",
  256. "format":"int64"
  257. }
  258. ],
  259. "responses":{
  260. "200":{
  261. "description":"successful operation",
  262. "schema":{
  263. "$ref":"#/definitions/Pet"
  264. }
  265. },
  266. "400":{
  267. "description":"Invalid ID supplied"
  268. },
  269. "404":{
  270. "description":"Pet not found"
  271. }
  272. },
  273. "security":[
  274. {
  275. "api_key":[
  276. ]
  277. }
  278. ]
  279. },
  280. "post":{
  281. "tags":[
  282. "pet"
  283. ],
  284. "summary":"Updates a pet in the store with form data",
  285. "description":"",
  286. "operationId":"updatePetWithForm",
  287. "consumes":[
  288. "application/x-www-form-urlencoded"
  289. ],
  290. "produces":[
  291. "application/xml",
  292. "application/json"
  293. ],
  294. "parameters":[
  295. {
  296. "name":"petId",
  297. "in":"path",
  298. "description":"ID of pet that needs to be updated",
  299. "required":true,
  300. "type":"integer",
  301. "format":"int64"
  302. },
  303. {
  304. "name":"name",
  305. "in":"formData",
  306. "description":"Updated name of the pet",
  307. "required":false,
  308. "type":"string"
  309. },
  310. {
  311. "name":"status",
  312. "in":"formData",
  313. "description":"Updated status of the pet",
  314. "required":false,
  315. "type":"string"
  316. }
  317. ],
  318. "responses":{
  319. "405":{
  320. "description":"Invalid input"
  321. }
  322. },
  323. "security":[
  324. {
  325. "petstore_auth":[
  326. "write:pets",
  327. "read:pets"
  328. ]
  329. }
  330. ]
  331. },
  332. "delete":{
  333. "tags":[
  334. "pet"
  335. ],
  336. "summary":"Deletes a pet",
  337. "description":"",
  338. "operationId":"deletePet",
  339. "produces":[
  340. "application/xml",
  341. "application/json"
  342. ],
  343. "parameters":[
  344. {
  345. "name":"api_key",
  346. "in":"header",
  347. "required":false,
  348. "type":"string"
  349. },
  350. {
  351. "name":"petId",
  352. "in":"path",
  353. "description":"Pet id to delete",
  354. "required":true,
  355. "type":"integer",
  356. "format":"int64"
  357. }
  358. ],
  359. "responses":{
  360. "400":{
  361. "description":"Invalid ID supplied"
  362. },
  363. "404":{
  364. "description":"Pet not found"
  365. }
  366. },
  367. "security":[
  368. {
  369. "petstore_auth":[
  370. "write:pets",
  371. "read:pets"
  372. ]
  373. }
  374. ]
  375. }
  376. },
  377. "/pet/{petId}/uploadImage":{
  378. "post":{
  379. "tags":[
  380. "pet"
  381. ],
  382. "summary":"uploads an image",
  383. "description":"",
  384. "operationId":"uploadFile",
  385. "consumes":[
  386. "multipart/form-data"
  387. ],
  388. "produces":[
  389. "application/json"
  390. ],
  391. "parameters":[
  392. {
  393. "name":"petId",
  394. "in":"path",
  395. "description":"ID of pet to update",
  396. "required":true,
  397. "type":"integer",
  398. "format":"int64"
  399. },
  400. {
  401. "name":"additionalMetadata",
  402. "in":"formData",
  403. "description":"Additional data to pass to server",
  404. "required":false,
  405. "type":"string"
  406. },
  407. {
  408. "name":"file",
  409. "in":"formData",
  410. "description":"file to upload",
  411. "required":false,
  412. "type":"file"
  413. }
  414. ],
  415. "responses":{
  416. "200":{
  417. "description":"successful operation",
  418. "schema":{
  419. "$ref":"#/definitions/ApiResponse"
  420. }
  421. }
  422. },
  423. "security":[
  424. {
  425. "petstore_auth":[
  426. "write:pets",
  427. "read:pets"
  428. ]
  429. }
  430. ]
  431. }
  432. },
  433. "/store/inventory":{
  434. "get":{
  435. "tags":[
  436. "store"
  437. ],
  438. "summary":"Returns pet inventories by status",
  439. "description":"Returns a map of status codes to quantities",
  440. "operationId":"getInventory",
  441. "produces":[
  442. "application/json"
  443. ],
  444. "parameters":[
  445. ],
  446. "responses":{
  447. "200":{
  448. "description":"successful operation",
  449. "schema":{
  450. "type":"object",
  451. "additionalProperties":{
  452. "type":"integer",
  453. "format":"int32"
  454. }
  455. }
  456. }
  457. },
  458. "security":[
  459. {
  460. "api_key":[
  461. ]
  462. }
  463. ]
  464. }
  465. },
  466. "/store/order":{
  467. "post":{
  468. "tags":[
  469. "store"
  470. ],
  471. "summary":"Place an order for a pet",
  472. "description":"",
  473. "operationId":"placeOrder",
  474. "produces":[
  475. "application/xml",
  476. "application/json"
  477. ],
  478. "parameters":[
  479. {
  480. "in":"body",
  481. "name":"body",
  482. "description":"order placed for purchasing the pet",
  483. "required":true,
  484. "schema":{
  485. "$ref":"#/definitions/Order"
  486. }
  487. }
  488. ],
  489. "responses":{
  490. "200":{
  491. "description":"successful operation",
  492. "schema":{
  493. "$ref":"#/definitions/Order"
  494. }
  495. },
  496. "400":{
  497. "description":"Invalid Order"
  498. }
  499. }
  500. }
  501. },
  502. "/store/order/{orderId}":{
  503. "get":{
  504. "tags":[
  505. "store"
  506. ],
  507. "summary":"Find purchase order by ID",
  508. "description":"For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions",
  509. "operationId":"getOrderById",
  510. "produces":[
  511. "application/xml",
  512. "application/json"
  513. ],
  514. "parameters":[
  515. {
  516. "name":"orderId",
  517. "in":"path",
  518. "description":"ID of pet that needs to be fetched",
  519. "required":true,
  520. "type":"integer",
  521. "maximum":10.0,
  522. "minimum":1.0,
  523. "format":"int64"
  524. }
  525. ],
  526. "responses":{
  527. "200":{
  528. "description":"successful operation",
  529. "schema":{
  530. "$ref":"#/definitions/Order"
  531. }
  532. },
  533. "400":{
  534. "description":"Invalid ID supplied"
  535. },
  536. "404":{
  537. "description":"Order not found"
  538. }
  539. }
  540. },
  541. "delete":{
  542. "tags":[
  543. "store"
  544. ],
  545. "summary":"Delete purchase order by ID",
  546. "description":"For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors",
  547. "operationId":"deleteOrder",
  548. "produces":[
  549. "application/xml",
  550. "application/json"
  551. ],
  552. "parameters":[
  553. {
  554. "name":"orderId",
  555. "in":"path",
  556. "description":"ID of the order that needs to be deleted",
  557. "required":true,
  558. "type":"integer",
  559. "minimum":1.0,
  560. "format":"int64"
  561. }
  562. ],
  563. "responses":{
  564. "400":{
  565. "description":"Invalid ID supplied"
  566. },
  567. "404":{
  568. "description":"Order not found"
  569. }
  570. }
  571. }
  572. },
  573. "/user":{
  574. "post":{
  575. "tags":[
  576. "user"
  577. ],
  578. "summary":"Create user",
  579. "description":"This can only be done by the logged in user.",
  580. "operationId":"createUser",
  581. "produces":[
  582. "application/xml",
  583. "application/json"
  584. ],
  585. "parameters":[
  586. {
  587. "in":"body",
  588. "name":"body",
  589. "description":"Created user object",
  590. "required":true,
  591. "schema":{
  592. "$ref":"#/definitions/User"
  593. }
  594. }
  595. ],
  596. "responses":{
  597. "default":{
  598. "description":"successful operation"
  599. }
  600. }
  601. }
  602. },
  603. "/user/createWithArray":{
  604. "post":{
  605. "tags":[
  606. "user"
  607. ],
  608. "summary":"Creates list of users with given input array",
  609. "description":"",
  610. "operationId":"createUsersWithArrayInput",
  611. "produces":[
  612. "application/xml",
  613. "application/json"
  614. ],
  615. "parameters":[
  616. {
  617. "in":"body",
  618. "name":"body",
  619. "description":"List of user object",
  620. "required":true,
  621. "schema":{
  622. "type":"array",
  623. "items":{
  624. "$ref":"#/definitions/User"
  625. }
  626. }
  627. }
  628. ],
  629. "responses":{
  630. "default":{
  631. "description":"successful operation"
  632. }
  633. }
  634. }
  635. },
  636. "/user/createWithList":{
  637. "post":{
  638. "tags":[
  639. "user"
  640. ],
  641. "summary":"Creates list of users with given input array",
  642. "description":"",
  643. "operationId":"createUsersWithListInput",
  644. "produces":[
  645. "application/xml",
  646. "application/json"
  647. ],
  648. "parameters":[
  649. {
  650. "in":"body",
  651. "name":"body",
  652. "description":"List of user object",
  653. "required":true,
  654. "schema":{
  655. "type":"array",
  656. "items":{
  657. "$ref":"#/definitions/User"
  658. }
  659. }
  660. }
  661. ],
  662. "responses":{
  663. "default":{
  664. "description":"successful operation"
  665. }
  666. }
  667. }
  668. },
  669. "/user/login":{
  670. "get":{
  671. "tags":[
  672. "user"
  673. ],
  674. "summary":"Logs user into the system",
  675. "description":"",
  676. "operationId":"loginUser",
  677. "produces":[
  678. "application/xml",
  679. "application/json"
  680. ],
  681. "parameters":[
  682. {
  683. "name":"username",
  684. "in":"query",
  685. "description":"The user name for login",
  686. "required":true,
  687. "type":"string"
  688. },
  689. {
  690. "name":"password",
  691. "in":"query",
  692. "description":"The password for login in clear text",
  693. "required":true,
  694. "type":"string"
  695. }
  696. ],
  697. "responses":{
  698. "200":{
  699. "description":"successful operation",
  700. "schema":{
  701. "type":"string"
  702. },
  703. "headers":{
  704. "X-Rate-Limit":{
  705. "type":"integer",
  706. "format":"int32",
  707. "description":"calls per hour allowed by the user"
  708. },
  709. "X-Expires-After":{
  710. "type":"string",
  711. "format":"date-time",
  712. "description":"date in UTC when token expires"
  713. }
  714. }
  715. },
  716. "400":{
  717. "description":"Invalid username/password supplied"
  718. }
  719. }
  720. }
  721. },
  722. "/user/logout":{
  723. "get":{
  724. "tags":[
  725. "user"
  726. ],
  727. "summary":"Logs out current logged in user session",
  728. "description":"",
  729. "operationId":"logoutUser",
  730. "produces":[
  731. "application/xml",
  732. "application/json"
  733. ],
  734. "parameters":[
  735. ],
  736. "responses":{
  737. "default":{
  738. "description":"successful operation"
  739. }
  740. }
  741. }
  742. },
  743. "/user/{username}":{
  744. "get":{
  745. "tags":[
  746. "user"
  747. ],
  748. "summary":"Get user by user name",
  749. "description":"",
  750. "operationId":"getUserByName",
  751. "produces":[
  752. "application/xml",
  753. "application/json"
  754. ],
  755. "parameters":[
  756. {
  757. "name":"username",
  758. "in":"path",
  759. "description":"The name that needs to be fetched. Use user1 for testing. ",
  760. "required":true,
  761. "type":"string"
  762. }
  763. ],
  764. "responses":{
  765. "200":{
  766. "description":"successful operation",
  767. "schema":{
  768. "$ref":"#/definitions/User"
  769. }
  770. },
  771. "400":{
  772. "description":"Invalid username supplied"
  773. },
  774. "404":{
  775. "description":"User not found"
  776. }
  777. }
  778. },
  779. "put":{
  780. "tags":[
  781. "user"
  782. ],
  783. "summary":"Updated user",
  784. "description":"This can only be done by the logged in user.",
  785. "operationId":"updateUser",
  786. "produces":[
  787. "application/xml",
  788. "application/json"
  789. ],
  790. "parameters":[
  791. {
  792. "name":"username",
  793. "in":"path",
  794. "description":"name that need to be updated",
  795. "required":true,
  796. "type":"string"
  797. },
  798. {
  799. "in":"body",
  800. "name":"body",
  801. "description":"Updated user object",
  802. "required":true,
  803. "schema":{
  804. "$ref":"#/definitions/User"
  805. }
  806. }
  807. ],
  808. "responses":{
  809. "400":{
  810. "description":"Invalid user supplied"
  811. },
  812. "404":{
  813. "description":"User not found"
  814. }
  815. }
  816. },
  817. "delete":{
  818. "tags":[
  819. "user"
  820. ],
  821. "summary":"Delete user",
  822. "description":"This can only be done by the logged in user.",
  823. "operationId":"deleteUser",
  824. "produces":[
  825. "application/xml",
  826. "application/json"
  827. ],
  828. "parameters":[
  829. {
  830. "name":"username",
  831. "in":"path",
  832. "description":"The name that needs to be deleted",
  833. "required":true,
  834. "type":"string"
  835. }
  836. ],
  837. "responses":{
  838. "400":{
  839. "description":"Invalid username supplied"
  840. },
  841. "404":{
  842. "description":"User not found"
  843. }
  844. }
  845. }
  846. }
  847. },
  848. "securityDefinitions":{
  849. "petstore_auth":{
  850. "type":"oauth2",
  851. "authorizationUrl":"http://petstore.swagger.io/oauth/dialog",
  852. "flow":"implicit",
  853. "scopes":{
  854. "write:pets":"modify pets in your account",
  855. "read:pets":"read your pets"
  856. }
  857. },
  858. "api_key":{
  859. "type":"apiKey",
  860. "name":"api_key",
  861. "in":"header"
  862. }
  863. },
  864. "definitions":{
  865. "Order":{
  866. "type":"object",
  867. "properties":{
  868. "id":{
  869. "type":"integer",
  870. "format":"int64"
  871. },
  872. "petId":{
  873. "type":"integer",
  874. "format":"int64"
  875. },
  876. "quantity":{
  877. "type":"integer",
  878. "format":"int32"
  879. },
  880. "shipDate":{
  881. "type":"string",
  882. "format":"date-time"
  883. },
  884. "status":{
  885. "type":"string",
  886. "description":"Order Status",
  887. "enum":[
  888. "placed",
  889. "approved",
  890. "delivered"
  891. ]
  892. },
  893. "complete":{
  894. "type":"boolean",
  895. "default":false
  896. }
  897. },
  898. "xml":{
  899. "name":"Order"
  900. }
  901. },
  902. "Category":{
  903. "type":"object",
  904. "properties":{
  905. "id":{
  906. "type":"integer",
  907. "format":"int64"
  908. },
  909. "name":{
  910. "type":"string"
  911. }
  912. },
  913. "xml":{
  914. "name":"Category"
  915. }
  916. },
  917. "User":{
  918. "type":"object",
  919. "properties":{
  920. "id":{
  921. "type":"integer",
  922. "format":"int64"
  923. },
  924. "username":{
  925. "type":"string"
  926. },
  927. "firstName":{
  928. "type":"string"
  929. },
  930. "lastName":{
  931. "type":"string"
  932. },
  933. "email":{
  934. "type":"string"
  935. },
  936. "password":{
  937. "type":"string"
  938. },
  939. "phone":{
  940. "type":"string"
  941. },
  942. "userStatus":{
  943. "type":"integer",
  944. "format":"int32",
  945. "description":"User Status"
  946. }
  947. },
  948. "xml":{
  949. "name":"User"
  950. }
  951. },
  952. "Tag":{
  953. "type":"object",
  954. "properties":{
  955. "id":{
  956. "type":"integer",
  957. "format":"int64"
  958. },
  959. "name":{
  960. "type":"string"
  961. }
  962. },
  963. "xml":{
  964. "name":"Tag"
  965. }
  966. },
  967. "Pet":{
  968. "type":"object",
  969. "required":[
  970. "name",
  971. "photoUrls"
  972. ],
  973. "properties":{
  974. "id":{
  975. "type":"integer",
  976. "format":"int64"
  977. },
  978. "category":{
  979. "$ref":"#/definitions/Category"
  980. },
  981. "name":{
  982. "type":"string",
  983. "example":"doggie"
  984. },
  985. "photoUrls":{
  986. "type":"array",
  987. "xml":{
  988. "name":"photoUrl",
  989. "wrapped":true
  990. },
  991. "items":{
  992. "type":"string"
  993. }
  994. },
  995. "tags":{
  996. "type":"array",
  997. "xml":{
  998. "name":"tag",
  999. "wrapped":true
  1000. },
  1001. "items":{
  1002. "$ref":"#/definitions/Tag"
  1003. }
  1004. },
  1005. "status":{
  1006. "type":"string",
  1007. "description":"pet status in the store",
  1008. "enum":[
  1009. "available",
  1010. "pending",
  1011. "sold"
  1012. ]
  1013. }
  1014. },
  1015. "xml":{
  1016. "name":"Pet"
  1017. }
  1018. },
  1019. "ApiResponse":{
  1020. "type":"object",
  1021. "properties":{
  1022. "code":{
  1023. "type":"integer",
  1024. "format":"int32"
  1025. },
  1026. "type":{
  1027. "type":"string"
  1028. },
  1029. "message":{
  1030. "type":"string"
  1031. }
  1032. }
  1033. }
  1034. },
  1035. "externalDocs":{
  1036. "description":"Find out more about Swagger",
  1037. "url":"http://swagger.io"
  1038. }
  1039. }