Advertisement
Guest User

Untitled

a guest
May 7th, 2017
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.35 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/order:
  267. post:
  268. tags:
  269. - "shop"
  270. summary: "Place an order for a pet"
  271. description: ""
  272. operationId: "addOrder"
  273. produces:
  274. - "application/xml"
  275. - "application/json"
  276. parameters:
  277. - in: "body"
  278. name: "body"
  279. description: "order placed for purchasing the pet"
  280. required: true
  281. schema:
  282. $ref: "#/definitions/Order"
  283. responses:
  284. 200:
  285. description: "successful operation"
  286. schema:
  287. $ref: "#/definitions/Order"
  288. 400:
  289. description: "Invalid Order"
  290. /shop/order/{orderId}:
  291. get:
  292. tags:
  293. - "shop"
  294. summary: "Find purchase order by ID"
  295. description: "For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions"
  296. operationId: "getOrderById"
  297. produces:
  298. - "application/xml"
  299. - "application/json"
  300. parameters:
  301. - name: "orderId"
  302. in: "path"
  303. description: "ID of pet that needs to be fetched"
  304. required: true
  305. type: "integer"
  306. maximum: 10.0
  307. minimum: 1.0
  308. format: "int64"
  309. responses:
  310. 200:
  311. description: "successful operation"
  312. schema:
  313. $ref: "#/definitions/Order"
  314. 400:
  315. description: "Invalid ID supplied"
  316. 404:
  317. description: "Order not found"
  318. delete:
  319. tags:
  320. - "shop"
  321. summary: "Delete purchase order by ID"
  322. description: "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors"
  323. operationId: "deleteOrder"
  324. produces:
  325. - "application/xml"
  326. - "application/json"
  327. parameters:
  328. - name: "orderId"
  329. in: "path"
  330. description: "ID of the order that needs to be deleted"
  331. required: true
  332. type: "integer"
  333. minimum: 1.0
  334. format: "int64"
  335. responses:
  336. 400:
  337. description: "Invalid ID supplied"
  338. 404:
  339. description: "Order not found"
  340. /user:
  341. post:
  342. tags:
  343. - "user"
  344. summary: "Create user"
  345. description: "This can only be done by the logged in user."
  346. operationId: "createUser"
  347. produces:
  348. - "application/xml"
  349. - "application/json"
  350. parameters:
  351. - in: "body"
  352. name: "body"
  353. description: "Created user object"
  354. required: true
  355. schema:
  356. $ref: "#/definitions/User"
  357. responses:
  358. default:
  359. description: "successful operation"
  360.  
  361.  
  362. /user/login: //tutaj jak mam to rozumieć? :p ten nick jako login i name do wyświetlenia tak? w sumie to nie wiem :D
  363. get:
  364. tags:
  365. - "user"
  366. summary: "Logs user into the system"
  367. description: ""
  368. operationId: "loginUser"
  369. produces:
  370. - "application/xml"
  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/xml"
  408. - "application/json"
  409. parameters: []
  410. responses:
  411. default:
  412. description: "successful operation"
  413. /user/{username}:
  414. get:
  415. tags:
  416. - "user"
  417. summary: "Get user by user name"
  418. description: ""
  419. operationId: "getUserByName"
  420. produces:
  421. - "application/xml"
  422. - "application/json"
  423. parameters:
  424. - name: "username"
  425. in: "path"
  426. description: "The name that needs to be fetched. Use user1 for testing. "
  427. required: true
  428. type: "string"
  429. responses:
  430. 200:
  431. description: "successful operation"
  432. schema:
  433. $ref: "#/definitions/User"
  434. 400:
  435. description: "Invalid username supplied"
  436. 404:
  437. description: "User not found"
  438. put:
  439. tags:
  440. - "user"
  441. summary: "Updated user"
  442. description: "This can only be done by the logged in user."
  443. operationId: "updateUser"
  444. produces:
  445. - "application/xml"
  446. - "application/json"
  447. parameters:
  448. - name: "username"
  449. in: "path"
  450. description: "name that need to be updated"
  451. required: true
  452. type: "string"
  453. - in: "body"
  454. name: "body"
  455. description: "Updated user object"
  456. required: true
  457. schema:
  458. $ref: "#/definitions/User"
  459. responses:
  460. 400:
  461. description: "Invalid user supplied"
  462. 404:
  463. description: "User not found"
  464. delete:
  465. tags:
  466. - "user"
  467. summary: "Delete user"
  468. description: "This can only be done by the logged in user."
  469. operationId: "deleteUser"
  470. produces:
  471. - "application/xml"
  472. - "application/json"
  473. parameters:
  474. - name: "username"
  475. in: "path"
  476. description: "The name that needs to be deleted"
  477. required: true
  478. type: "string"
  479. responses:
  480. 400:
  481. description: "Invalid username supplied"
  482. 404:
  483. description: "User not found"
  484. securityDefinitions:
  485. petstore_auth:
  486. type: "oauth2"
  487. authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
  488. flow: "implicit"
  489. scopes:
  490. write:pets: "modify products in your account"
  491. read:pets: "read your products"
  492. api_key:
  493. type: "apiKey"
  494. name: "api_key"
  495. in: "header"
  496. definitions:
  497. Order:
  498. type: "object"
  499. properties:
  500. id:
  501. type: "integer"
  502. format: "int64"
  503. quantity:
  504. type: "integer"
  505. format: "int32"
  506. shipDate:
  507. type: "string"
  508. format: "date-time"
  509. status:
  510. type: "string"
  511. description: "Order Status"
  512. enum:
  513. - "placed"
  514. - "approved"
  515. - "delivered"
  516. productId:
  517. type: "integer"
  518. format: "int64"
  519. complete:
  520. type: "boolean"
  521. default: false
  522. xml:
  523. name: "Order"
  524. Category:
  525. type: "object"
  526. properties:
  527. id:
  528. type: "integer"
  529. format: "int64"
  530. name:
  531. type: "string"
  532. xml:
  533. name: "Category"
  534. User:
  535. type: "object"
  536. properties:
  537. id:
  538. type: "integer"
  539. format: "int64"
  540. username:
  541. type: "string"
  542. firstName:
  543. type: "string"
  544. lastName:
  545. type: "string"
  546. email:
  547. type: "string"
  548. password:
  549. type: "string"
  550. phone:
  551. type: "string"
  552. userStatus:
  553. type: "integer"
  554. format: "int32"
  555. description: "User Status"
  556. xml:
  557. name: "User"
  558. Pet:
  559. type: "object"
  560. required:
  561. - "name"
  562. - "photoUrls"
  563. properties:
  564. id:
  565. type: "integer"
  566. format: "int64"
  567. category:
  568. $ref: "#/definitions/Category"
  569. name:
  570. type: "string"
  571. example: "doggie"
  572. photoUrls:
  573. type: "array"
  574. xml:
  575. name: "photoUrl"
  576. wrapped: true
  577. items:
  578. type: "string"
  579. tags:
  580. type: "array"
  581. xml:
  582. name: "tag"
  583. wrapped: true
  584. items:
  585. $ref: "#/definitions/Tag"
  586. status:
  587. type: "string"
  588. description: "pet status in the store"
  589. enum:
  590. - "available"
  591. - "pending"
  592. - "sold"
  593. xml:
  594. name: "Pet"
  595. ApiResponse:
  596. type: "object"
  597. properties:
  598. code:
  599. type: "integer"
  600. format: "int32"
  601. type:
  602. type: "string"
  603. message:
  604. type: "string"
  605. externalDocs:
  606. description: "Find out more about Swagger"
  607. url: "http://swagger.io"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement