Advertisement
Guest User

Untitled

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