You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

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