Advertisement
Guest User

Untitled

a guest
May 9th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.54 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3. description: "API DO FIT SHOP"
  4. version: "1.0.0"
  5. title: "FITSHOP"
  6. termsOfService: "http://swagger.io/terms/"
  7. contact:
  8. email: "apiteam@swagger.io"
  9. license:
  10. name: "Apache 2.0"
  11. url: "http://www.apache.org/licenses/LICENSE-2.0.html"
  12. host: "petstore.swagger.io"
  13. basePath: "/v2"
  14. tags:
  15. - name: "fit"
  16. description: "Everything about your Pets"
  17. externalDocs:
  18. description: "Find out more"
  19. url: "http://swagger.io"
  20. - name: "store"
  21. description: "Access to Petstore orders"
  22. - name: "user"
  23. description: "Operations about user"
  24. externalDocs:
  25. description: "Find out more about our store"
  26. url: "http://swagger.io"
  27. schemes:
  28. - "http"
  29. paths:
  30. /products:
  31. post:
  32. tags:
  33. - "product"
  34. summary: "Dodaj nowy produkt"
  35. description: ""
  36. operationId: "addProduct"
  37. consumes:
  38. - "application/json"
  39. - "application/xml"
  40. produces:
  41. - "application/xml"
  42. - "application/json"
  43. parameters:
  44. - in: "body"
  45. name: "body"
  46. description: "Pet object that needs to be added to the store"
  47. required: true
  48. schema:
  49. $ref: "#/definitions/Pet"
  50. responses:
  51. 405:
  52. description: "Invalid input"
  53. security:
  54. - petstore_auth:
  55. - "write:pets"
  56. - "read:pets"
  57.  
  58.  
  59. /products/search/{productId}:
  60. get:
  61. tags:
  62. - "product"
  63. summary: "Finds products by status"
  64. description: "Multiple status values can be provided with comma separated strings"
  65. operationId: "findProduct"
  66. produces:
  67. - "application/xml"
  68. - "application/json"
  69. parameters:
  70. - name: "productId"
  71. in: "path"
  72. description: "Status values that need to be considered for filter"
  73. required: true
  74. type: "string"
  75. responses:
  76. 200:
  77. description: "successful operation"
  78. schema:
  79. type: "array"
  80. items:
  81. $ref: "#/definitions/Pet"
  82. 400:
  83. description: "Invalid status value"
  84. security:
  85. - petstore_auth:
  86. - "write:pets"
  87. - "read:pets"
  88. /products/search/{category}/{productId}:
  89. get:
  90. tags:
  91. - "pet"
  92. summary: "Finds Pets by tags"
  93. description: "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing."
  94. operationId: "findPetsByTags"
  95. produces:
  96. - "application/xml"
  97. - "application/json"
  98. parameters:
  99. - name: "productId"
  100. in: "path"
  101. type: integer
  102. description: "Tags to filter by"
  103. required: true
  104. - name: "category"
  105. in: "path"
  106. type: string
  107. description: "Tags to filter by"
  108. required: true
  109. responses:
  110. 200:
  111. description: "successful operation"
  112. schema:
  113. type: "array"
  114. items:
  115. $ref: "#/definitions/Pet"
  116. 400:
  117. description: "Invalid tag value"
  118. security:
  119. - petstore_auth:
  120. - "write:pets"
  121. - "read:pets"
  122. deprecated: true
  123. /product/{productId}:
  124. get:
  125. tags:
  126. - "pet"
  127. summary: "Find pet by ID"
  128. description: "Returns a single pet"
  129. operationId: "getProductById"
  130. produces:
  131. - "application/xml"
  132. - "application/json"
  133. parameters:
  134. - name: "productId"
  135. in: "path"
  136. description: "ID of pet to return"
  137. required: true
  138. type: "integer"
  139. format: "int64"
  140. responses:
  141. 200:
  142. description: "successful operation"
  143. schema:
  144. $ref: "#/definitions/Pet"
  145. 400:
  146. description: "Invalid ID supplied"
  147. 404:
  148. description: "Pet not found"
  149. security:
  150. - api_key: []
  151. post:
  152. tags:
  153. - "pet"
  154. summary: "Updates a pet in the store with form data"
  155. description: ""
  156. operationId: "updatePetWithForm"
  157. consumes:
  158. - "application/x-www-form-urlencoded"
  159. produces:
  160. - "application/xml"
  161. - "application/json"
  162. parameters:
  163. - name: "productId"
  164. in: "path"
  165. description: "ID of pet that needs to be updated"
  166. required: true
  167. type: "integer"
  168. format: "int64"
  169. - name: "name"
  170. in: "formData"
  171. description: "Updated name of the pet"
  172. required: false
  173. type: "string"
  174. - name: "status"
  175. in: "formData"
  176. description: "Updated status of the pet"
  177. required: false
  178. type: "string"
  179. responses:
  180. 405:
  181. description: "Invalid input"
  182. security:
  183. - petstore_auth:
  184. - "write:pets"
  185. - "read:pets"
  186. put:
  187. tags:
  188. - "product"
  189. summary: "Update an existing produkt"
  190. description: ""
  191. operationId: "updateProduct"
  192. consumes:
  193. - "application/json"
  194. - "application/xml"
  195. produces:
  196. - "application/xml"
  197. - "application/json"
  198. parameters:
  199. - in: "body"
  200. name: "body"
  201. description: "Product that needs to be added to the store"
  202. required: true
  203. schema:
  204. $ref: "#/definitions/Pet"
  205. responses:
  206. 400:
  207. description: "Invalid ID supplied"
  208. 404:
  209. description: "Pet not found"
  210. 405:
  211. description: "Validation exception"
  212. security:
  213. - petstore_auth:
  214. - "write:pets"
  215. - "read:pets"
  216.  
  217. delete:
  218. tags:
  219. - "product"
  220. summary: "Deletes products"
  221. description: ""
  222. operationId: "deleteProduct"
  223. produces:
  224. - "application/xml"
  225. - "application/json"
  226. parameters:
  227. - name: "api_key"
  228. in: "header"
  229. required: false
  230. type: "string"
  231. - name: "productId"
  232. in: "path"
  233. description: "Product id to delete"
  234. required: true
  235. type: "integer"
  236. format: "int64"
  237. responses:
  238. 400:
  239. description: "Invalid ID supplied"
  240. 404:
  241. description: "Pet not found"
  242. security:
  243. - petstore_auth:
  244. - "write:pets"
  245. - "read:pets"
  246. /shop:
  247. get:
  248. tags:
  249. - "shop"
  250. summary: "Returns pet inventories by status"
  251. description: "Returns a map of status codes to quantities"
  252. operationId: "getInventory"
  253. produces:
  254. - "application/json"
  255. parameters: []
  256. responses:
  257. 200:
  258. description: "successful operation"
  259. schema:
  260. type: "object"
  261. additionalProperties:
  262. type: "integer"
  263. format: "int32"
  264. security:
  265. - api_key: []
  266. /shop/product:
  267. post:
  268. tags:
  269. - "shop"
  270. summary: "Dodaj nowy produkt"
  271. description: ""
  272. operationId: "addShopProduct"
  273. consumes:
  274. - "application/json"
  275. - "application/xml"
  276. produces:
  277. - "application/xml"
  278. - "application/json"
  279. parameters:
  280. - in: "body"
  281. name: "body"
  282. description: "Pet object that needs to be added to the store"
  283. required: true
  284. schema:
  285. $ref: "#/definitions/Product_makro"
  286. responses:
  287. 405:
  288. description: "Invalid input"
  289. security:
  290. - petstore_auth:
  291. - "write:pets"
  292. - "read:pets"
  293. /shop/order:
  294. post:
  295. tags:
  296. - "shop"
  297. summary: "Place an order for a pet"
  298. description: ""
  299. operationId: "addOrder"
  300. produces:
  301. - "application/xml"
  302. - "application/json"
  303. parameters:
  304. - in: "body"
  305. name: "body"
  306. description: "order placed for purchasing the pet"
  307. required: true
  308. schema:
  309. $ref: "#/definitions/Order"
  310. responses:
  311. 200:
  312. description: "successful operation"
  313. schema:
  314. $ref: "#/definitions/Order"
  315. 400:
  316. description: "Invalid Order"
  317. /shop/order/{orderId}:
  318. get:
  319. tags:
  320. - "shop"
  321. summary: "Find purchase order by ID"
  322. description: "For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions"
  323. operationId: "getOrderById"
  324. produces:
  325. - "application/xml"
  326. - "application/json"
  327. parameters:
  328. - name: "orderId"
  329. in: "path"
  330. description: "ID of pet that needs to be fetched"
  331. required: true
  332. type: "integer"
  333. maximum: 10.0
  334. minimum: 1.0
  335. format: "int64"
  336. responses:
  337. 200:
  338. description: "successful operation"
  339. schema:
  340. $ref: "#/definitions/Order"
  341. 400:
  342. description: "Invalid ID supplied"
  343. 404:
  344. description: "Order not found"
  345. delete:
  346. tags:
  347. - "shop"
  348. summary: "Delete purchase order by ID"
  349. description: "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors"
  350. operationId: "deleteOrder"
  351. produces:
  352. - "application/xml"
  353. - "application/json"
  354. parameters:
  355. - name: "orderId"
  356. in: "path"
  357. description: "ID of the order that needs to be deleted"
  358. required: true
  359. type: "integer"
  360. minimum: 1.0
  361. format: "int64"
  362. responses:
  363. 400:
  364. description: "Invalid ID supplied"
  365. 404:
  366. description: "Order not found"
  367. /user:
  368. post:
  369. tags:
  370. - "user"
  371. summary: "Create user"
  372. description: "This can only be done by the logged in user."
  373. operationId: "createUser"
  374. produces:
  375. - "application/xml"
  376. - "application/json"
  377. parameters:
  378. - in: "body"
  379. name: "body"
  380. description: "Created user object"
  381. required: true
  382. schema:
  383. $ref: "#/definitions/User"
  384. responses:
  385. default:
  386. description: "successful operation"
  387.  
  388.  
  389. /user/login:
  390. get:
  391. tags:
  392. - "user"
  393. summary: "Logs user into the system"
  394. description: ""
  395. operationId: "loginUser"
  396. produces:
  397. - "application/xml"
  398. - "application/json"
  399. parameters:
  400. - name: "username"
  401. in: "query"
  402. description: "The user name for login"
  403. required: true
  404. type: "string"
  405. - name: "password"
  406. in: "query"
  407. description: "The password for login in clear text"
  408. required: true
  409. type: "string"
  410. responses:
  411. 200:
  412. description: "successful operation"
  413. schema:
  414. type: "string"
  415. headers:
  416. X-Rate-Limit:
  417. type: "integer"
  418. format: "int32"
  419. description: "calls per hour allowed by the user"
  420. X-Expires-After:
  421. type: "string"
  422. format: "date-time"
  423. description: "date in UTC when token expires"
  424. 400:
  425. description: "Invalid username/password supplied"
  426. /user/logout:
  427. get:
  428. tags:
  429. - "user"
  430. summary: "Logs out current logged in user session"
  431. description: ""
  432. operationId: "logoutUser"
  433. produces:
  434. - "application/xml"
  435. - "application/json"
  436. parameters: []
  437. responses:
  438. default:
  439. description: "successful operation"
  440. /user/{username}:
  441. get:
  442. tags:
  443. - "user"
  444. summary: "Get user by user name"
  445. description: ""
  446. operationId: "getUserByName"
  447. produces:
  448. - "application/xml"
  449. - "application/json"
  450. parameters:
  451. - name: "username"
  452. in: "path"
  453. description: "The name that needs to be fetched. Use user1 for testing. "
  454. required: true
  455. type: "string"
  456. responses:
  457. 200:
  458. description: "successful operation"
  459. schema:
  460. $ref: "#/definitions/User"
  461. 400:
  462. description: "Invalid username supplied"
  463. 404:
  464. description: "User not found"
  465. put:
  466. tags:
  467. - "user"
  468. summary: "Updated user"
  469. description: "This can only be done by the logged in user."
  470. operationId: "updateUser"
  471. produces:
  472. - "application/xml"
  473. - "application/json"
  474. parameters:
  475. - name: "username"
  476. in: "path"
  477. description: "name that need to be updated"
  478. required: true
  479. type: "string"
  480. - in: "body"
  481. name: "body"
  482. description: "Updated user object"
  483. required: true
  484. schema:
  485. $ref: "#/definitions/User"
  486. responses:
  487. 400:
  488. description: "Invalid user supplied"
  489. 404:
  490. description: "User not found"
  491. delete:
  492. tags:
  493. - "user"
  494. summary: "Delete user"
  495. description: "This can only be done by the logged in user."
  496. operationId: "deleteUser"
  497. produces:
  498. - "application/xml"
  499. - "application/json"
  500. parameters:
  501. - name: "username"
  502. in: "path"
  503. description: "The name that needs to be deleted"
  504. required: true
  505. type: "string"
  506. responses:
  507. 400:
  508. description: "Invalid username supplied"
  509. 404:
  510. description: "User not found"
  511. securityDefinitions:
  512. petstore_auth:
  513. type: "oauth2"
  514. authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
  515. flow: "implicit"
  516. scopes:
  517. write:pets: "modify products in your account"
  518. read:pets: "read your products"
  519. api_key:
  520. type: "apiKey"
  521. name: "api_key"
  522. in: "header"
  523. definitions:
  524. Order:
  525. type: "object"
  526. properties:
  527. id:
  528. type: "integer"
  529. format: "int64"
  530. quantity:
  531. type: "integer"
  532. format: "int32"
  533. shipDate:
  534. type: "string"
  535. format: "date-time"
  536. status:
  537. type: "string"
  538. description: "Order Status"
  539. enum:
  540. - "placed"
  541. - "approved"
  542. - "delivered"
  543. productId:
  544. type: "integer"
  545. format: "int64"
  546. complete:
  547. type: "boolean"
  548. default: false
  549. xml:
  550. name: "Order"
  551. Category:
  552. type: "object"
  553. properties:
  554. id:
  555. type: "integer"
  556. format: "int64"
  557. name:
  558. type: "string"
  559. xml:
  560. name: "Category"
  561. User:
  562. type: "object"
  563. properties:
  564. id:
  565. type: "integer"
  566. format: "int64"
  567. username:
  568. type: "string"
  569. firstName:
  570. type: "string"
  571. lastName:
  572. type: "string"
  573. email:
  574. type: "string"
  575. password:
  576. type: "string"
  577. phone:
  578. type: "string"
  579. userStatus:
  580. type: "integer"
  581. format: "int32"
  582. description: "User Status"
  583. xml:
  584. name: "User"
  585. Product_makro:
  586. type: "object"
  587. required:
  588. - "bialko"
  589. - "tluszcz"
  590. - "wegle"
  591. properties:
  592. id:
  593. type: "integer"
  594. format: "int64"
  595. category:
  596. $ref: "#/definitions/Category"
  597. bialko:
  598. type: "integer"
  599. tluszcz:
  600. type: "integer"
  601. wegle:
  602. type: "integer"
  603. xml:
  604. name: "Pet"
  605. ApiResponse:
  606. type: "object"
  607. properties:
  608. code:
  609. type: "integer"
  610. format: "int32"
  611. type:
  612. type: "string"
  613. message:
  614. type: "string"
  615. externalDocs:
  616. description: "Find out more about Swagger"
  617. url: "http://swagger.io"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement