Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.72 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3. description: "centralized turtle base pair exchange."
  4. version: "1.0.0"
  5. title: "trtl.exchange"
  6.  
  7. host: "simple.api"
  8. basePath: "/v2"
  9. # tags:
  10. # - name: "withdraw"
  11. # description: "Users need to withdraw money"
  12. # - name: "deposit"
  13. # description: "Users need to deposit money"
  14. # - name: "user"
  15. # description: "Operations about user"
  16. # - name: "order"
  17. # description: "Operations about buysell orders"
  18. # - name: "wallet"
  19. # description: "Operations about wallets holding currency"
  20. # - name: "market"
  21. # description: "Operations about tradepairs"
  22. schemes:
  23. - "https"
  24. paths:
  25. /order:
  26. post:
  27. tags:
  28. - "order"
  29. summary: "Add a new order to the queue"
  30. description: ""
  31. operationId: "addOrder"
  32. consumes:
  33. - "application/json"
  34. produces:
  35. - "application/json"
  36. parameters:
  37. - in: "body"
  38. name: "body"
  39. description: "Order object that needs to be added to the queue"
  40. required: true
  41. schema:
  42. $ref: "#/definitions/Order"
  43. responses:
  44. 405:
  45. description: "Invalid input"
  46. security:
  47. - exchange_auth:
  48. - "write:orders"
  49. - "read:orders"
  50. put:
  51. tags:
  52. - "order"
  53. summary: "Update an existing order"
  54. description: ""
  55. operationId: "updateOrder"
  56. consumes:
  57. - "application/json"
  58. produces:
  59. - "application/json"
  60. parameters:
  61. - in: "body"
  62. name: "body"
  63. description: "Order object that needs to be added to the queue"
  64. required: true
  65. schema:
  66. $ref: "#/definitions/Order"
  67. responses:
  68. 400:
  69. description: "Invalid ID supplied"
  70. 404:
  71. description: "Order not found"
  72. 405:
  73. description: "Validation exception"
  74. /order/{orderId}:
  75. get:
  76. tags:
  77. - "order"
  78. summary: "Find order by ID"
  79. description: "Returns a single order"
  80. operationId: "getOrderById"
  81. produces:
  82. - "application/json"
  83. parameters:
  84. - name: "orderId"
  85. in: "path"
  86. description: "ID of order to return"
  87. required: true
  88. type: "integer"
  89. format: "int64"
  90. responses:
  91. 200:
  92. description: "successful operation"
  93. schema:
  94. $ref: "#/definitions/Order"
  95. 400:
  96. description: "Invalid ID supplied"
  97. 404:
  98. description: "Order not found"
  99. security:
  100. - api_key: []
  101. post:
  102. tags:
  103. - "order"
  104. summary: "Updates an order in the store with form data"
  105. description: ""
  106. operationId: "updateOrderWithForm"
  107. consumes:
  108. - "application/x-www-form-urlencoded"
  109. produces:
  110. - "application/json"
  111. parameters:
  112. - name: "orderId"
  113. in: "path"
  114. description: "ID of order that needs to be updated"
  115. required: true
  116. type: "integer"
  117. format: "int64"
  118. - name: "name"
  119. in: "formData"
  120. description: "Updated name of the order"
  121. required: false
  122. type: "string"
  123. - name: "status"
  124. in: "formData"
  125. description: "Updated status of the order"
  126. required: false
  127. type: "string"
  128. responses:
  129. 405:
  130. description: "Invalid input"
  131. delete:
  132. tags:
  133. - "order"
  134. summary: "Deletes an order"
  135. description: ""
  136. operationId: "deleteOrder"
  137. produces:
  138. - "application/json"
  139. parameters:
  140. - name: "api_key"
  141. in: "header"
  142. required: false
  143. type: "string"
  144. - name: "orderId"
  145. in: "path"
  146. description: "order id to delete"
  147. required: true
  148. type: "integer"
  149. format: "int64"
  150. responses:
  151. 400:
  152. description: "Invalid ID supplied"
  153. 404:
  154. description: "Order not found"
  155. /market:
  156. get:
  157. tags:
  158. - "market"
  159. summary: "get info about a market."
  160. description: ""
  161. operationId: "getMarket"
  162. consumes:
  163. - "application/json"
  164. produces:
  165. - "application/json"
  166. parameters:
  167. - name: "api_key"
  168. in: "header"
  169. required: false
  170. type: "string"
  171. - name: "orderId"
  172. in: "path"
  173. description: "order id to delete"
  174. required: true
  175. type: "integer"
  176. format: "int64"
  177. responses:
  178. 400:
  179. description: "Invalid ID supplied"
  180. 404:
  181. description: "Order not found"
  182. /market/trtl-mtip:
  183. get:
  184. tags:
  185. - "order"
  186. summary: "Find order by ID"
  187. description: "Returns a single order"
  188. operationId: "getMtip"
  189. produces:
  190. - "application/json"
  191. parameters:
  192. - name: "orderId"
  193. in: "path"
  194. description: "ID of order to return"
  195. required: true
  196. type: "integer"
  197. format: "int64"
  198. responses:
  199. 200:
  200. description: "successful operation"
  201. schema:
  202. $ref: "#/definitions/Order"
  203. 400:
  204. description: "Invalid ID supplied"
  205. 404:
  206. description: "Order not found"
  207. security:
  208. - api_key: []
  209. post:
  210. tags:
  211. - "order"
  212. summary: "Updates an order in the store with form data"
  213. description: ""
  214. operationId: "updateMtipOrderWithForm"
  215. consumes:
  216. - "application/x-www-form-urlencoded"
  217. produces:
  218. - "application/json"
  219. parameters:
  220. - name: "orderId"
  221. in: "path"
  222. description: "ID of order that needs to be updated"
  223. required: true
  224. type: "integer"
  225. format: "int64"
  226. - name: "name"
  227. in: "formData"
  228. description: "Updated name of the order"
  229. required: false
  230. type: "string"
  231. - name: "status"
  232. in: "formData"
  233. description: "Updated status of the order"
  234. required: false
  235. type: "string"
  236. responses:
  237. 405:
  238. description: "Invalid input"
  239. delete:
  240. tags:
  241. - "order"
  242. summary: "Deletes an order"
  243. description: ""
  244. operationId: "deleteMtipOrder"
  245. produces:
  246. - "application/json"
  247. parameters:
  248. - name: "api_key"
  249. in: "header"
  250. required: false
  251. type: "string"
  252. - name: "orderId"
  253. in: "path"
  254. description: "order id to delete"
  255. required: true
  256. type: "integer"
  257. format: "int64"
  258. responses:
  259. 400:
  260. description: "Invalid ID supplied"
  261. 404:
  262. description: "Order not found"
  263. /market/trtl-ple:
  264. get:
  265. tags:
  266. - "order"
  267. summary: "Find order by ID"
  268. description: "Returns a single order"
  269. operationId: "getPle"
  270. produces:
  271. - "application/json"
  272. parameters:
  273. - name: "orderId"
  274. in: "path"
  275. description: "ID of order to return"
  276. required: true
  277. type: "integer"
  278. format: "int64"
  279. responses:
  280. 200:
  281. description: "successful operation"
  282. schema:
  283. $ref: "#/definitions/Order"
  284. 400:
  285. description: "Invalid ID supplied"
  286. 404:
  287. description: "Order not found"
  288. security:
  289. - api_key: []
  290. post:
  291. tags:
  292. - "order"
  293. summary: "Updates an order in the store with form data"
  294. description: ""
  295. operationId: "updatePleOrderWithForm"
  296. consumes:
  297. - "application/x-www-form-urlencoded"
  298. produces:
  299. - "application/json"
  300. parameters:
  301. - name: "orderId"
  302. in: "path"
  303. description: "ID of order that needs to be updated"
  304. required: true
  305. type: "integer"
  306. format: "int64"
  307. - name: "name"
  308. in: "formData"
  309. description: "Updated name of the order"
  310. required: false
  311. type: "string"
  312. - name: "status"
  313. in: "formData"
  314. description: "Updated status of the order"
  315. required: false
  316. type: "string"
  317. responses:
  318. 405:
  319. description: "Invalid input"
  320. delete:
  321. tags:
  322. - "order"
  323. summary: "Deletes an order"
  324. description: ""
  325. operationId: "deletePleOrder"
  326. produces:
  327. - "application/json"
  328. parameters:
  329. - name: "api_key"
  330. in: "header"
  331. required: false
  332. type: "string"
  333. - name: "orderId"
  334. in: "path"
  335. description: "order id to delete"
  336. required: true
  337. type: "integer"
  338. format: "int64"
  339. responses:
  340. 400:
  341. description: "Invalid ID supplied"
  342. 404:
  343. description: "Order not found"
  344. /market/trtl-xmlc:
  345. get:
  346. tags:
  347. - "order"
  348. summary: "Find order by ID"
  349. description: "Returns a single order"
  350. operationId: "getXmlc"
  351. produces:
  352. - "application/json"
  353. parameters:
  354. - name: "orderId"
  355. in: "path"
  356. description: "ID of order to return"
  357. required: true
  358. type: "integer"
  359. format: "int64"
  360. responses:
  361. 200:
  362. description: "successful operation"
  363. schema:
  364. $ref: "#/definitions/Order"
  365. 400:
  366. description: "Invalid ID supplied"
  367. 404:
  368. description: "Order not found"
  369. security:
  370. - api_key: []
  371. post:
  372. tags:
  373. - "order"
  374. summary: "Updates an order in the store with form data"
  375. description: ""
  376. operationId: "updateXmlcOrderWithForm"
  377. consumes:
  378. - "application/x-www-form-urlencoded"
  379. produces:
  380. - "application/json"
  381. parameters:
  382. - name: "orderId"
  383. in: "path"
  384. description: "ID of order that needs to be updated"
  385. required: true
  386. type: "integer"
  387. format: "int64"
  388. - name: "name"
  389. in: "formData"
  390. description: "Updated name of the order"
  391. required: false
  392. type: "string"
  393. - name: "status"
  394. in: "formData"
  395. description: "Updated status of the order"
  396. required: false
  397. type: "string"
  398. responses:
  399. 405:
  400. description: "Invalid input"
  401. delete:
  402. tags:
  403. - "order"
  404. summary: "Deletes an order"
  405. description: ""
  406. operationId: "deleteXmlcOrder"
  407. produces:
  408. - "application/json"
  409. parameters:
  410. - name: "api_key"
  411. in: "header"
  412. required: false
  413. type: "string"
  414. - name: "orderId"
  415. in: "path"
  416. description: "order id to delete"
  417. required: true
  418. type: "integer"
  419. format: "int64"
  420. responses:
  421. 400:
  422. description: "Invalid ID supplied"
  423. 404:
  424. description: "Order not found"
  425. /user/{username}/wallet:
  426. post:
  427. tags:
  428. - "wallet"
  429. summary: "Add a new order to the queue"
  430. description: ""
  431. operationId: "addWallet"
  432. consumes:
  433. - "application/json"
  434. produces:
  435. - "application/json"
  436. parameters:
  437.  
  438. responses:
  439. 405:
  440. description: "Invalid input"
  441. security:
  442. - exchange_auth:
  443. - "write:wallets"
  444. - "read:wallets"
  445. put:
  446. tags:
  447. - "wallet"
  448. summary: "Update an existing wallet"
  449. description: ""
  450. operationId: "updateOrder"
  451. consumes:
  452. - "application/json"
  453. produces:
  454. - "application/json"
  455. parameters:
  456. - in: "body"
  457. name: "body"
  458. description: "Wallet object that needs to be added to the exchange"
  459. required: true
  460. schema:
  461. $ref: "#/definitions/Wallet"
  462. responses:
  463. 400:
  464. description: "Invalid ID supplied"
  465. 404:
  466. description: "Wallet not found"
  467. 405:
  468. description: "Validation exception"
  469.  
  470. /user:
  471. post:
  472. tags:
  473. - "user"
  474. summary: "Create user"
  475. description: "This can only be done by the logged in user."
  476. operationId: "createUser"
  477. produces:
  478. - "application/xml"
  479. - "application/json"
  480. parameters:
  481. - in: "body"
  482. name: "body"
  483. description: "Created user object"
  484. required: true
  485. schema:
  486. $ref: "#/definitions/User"
  487. responses:
  488. default:
  489. description: "successful operation"
  490. /user/login:
  491. get:
  492. tags:
  493. - "user"
  494. summary: "Logs user into the system"
  495. description: ""
  496. operationId: "loginUser"
  497. produces:
  498. - "application/xml"
  499. - "application/json"
  500. parameters:
  501. - name: "username"
  502. in: "query"
  503. description: "The user name for login"
  504. required: true
  505. type: "string"
  506. - name: "password"
  507. in: "query"
  508. description: "The password for login in clear text"
  509. required: true
  510. type: "string"
  511. responses:
  512. 200:
  513. description: "successful operation"
  514. schema:
  515. type: "string"
  516. headers:
  517. X-Rate-Limit:
  518. type: "integer"
  519. format: "int32"
  520. description: "calls per hour allowed by the user"
  521. X-Expires-After:
  522. type: "string"
  523. format: "date-time"
  524. description: "date in UTC when token expires"
  525. 400:
  526. description: "Invalid username/password supplied"
  527. /user/logout:
  528. get:
  529. tags:
  530. - "user"
  531. summary: "Logs out current logged in user session"
  532. description: ""
  533. operationId: "logoutUser"
  534. produces:
  535. - "application/xml"
  536. - "application/json"
  537. parameters: []
  538. responses:
  539. default:
  540. description: "successful operation"
  541. /user/{username}:
  542. get:
  543. tags:
  544. - "user"
  545. summary: "Get user by user name"
  546. description: ""
  547. operationId: "getUserByName"
  548. produces:
  549. - "application/xml"
  550. - "application/json"
  551. parameters:
  552. - name: "username"
  553. in: "path"
  554. description: "The name that needs to be fetched. Use user1 for testing. "
  555. required: true
  556. type: "string"
  557. responses:
  558. 200:
  559. description: "successful operation"
  560. schema:
  561. $ref: "#/definitions/User"
  562. 400:
  563. description: "Invalid username supplied"
  564. 404:
  565. description: "User not found"
  566. put:
  567. tags:
  568. - "user"
  569. summary: "Updated user"
  570. description: "This can only be done by the logged in user."
  571. operationId: "updateUser"
  572. produces:
  573. - "application/xml"
  574. - "application/json"
  575. parameters:
  576. - name: "username"
  577. in: "path"
  578. description: "name that need to be updated"
  579. required: true
  580. type: "string"
  581. - in: "body"
  582. name: "body"
  583. description: "Updated user object"
  584. required: true
  585. schema:
  586. $ref: "#/definitions/User"
  587. responses:
  588. 400:
  589. description: "Invalid user supplied"
  590. 404:
  591. description: "User not found"
  592. delete:
  593. tags:
  594. - "user"
  595. summary: "Delete user"
  596. description: "This can only be done by the logged in user."
  597. operationId: "deleteUser"
  598. produces:
  599. - "application/xml"
  600. - "application/json"
  601. parameters:
  602. - name: "username"
  603. in: "path"
  604. description: "The name that needs to be deleted"
  605. required: true
  606. type: "string"
  607. responses:
  608. 400:
  609. description: "Invalid username supplied"
  610. 404:
  611. description: "User not found"
  612. securityDefinitions:
  613. exchange_auth:
  614. type: "oauth2"
  615. authorizationUrl: "http://orderstore.swagger.io/oauth/dialog"
  616. flow: "implicit"
  617. scopes:
  618. write:orders: "modify orders in your account"
  619. read:orders: "read your orders"
  620. api_key:
  621. type: "apiKey"
  622. name: "api_key"
  623. in: "header"
  624. definitions:
  625. Category:
  626. type: "object"
  627. properties:
  628. id:
  629. type: "integer"
  630. format: "int64"
  631. name:
  632. type: "string"
  633. xml:
  634. name: "Category"
  635. User:
  636. type: "object"
  637. properties:
  638. id:
  639. type: "integer"
  640. format: "int64"
  641. username:
  642. type: "string"
  643. firstName:
  644. type: "string"
  645. lastName:
  646. type: "string"
  647. email:
  648. type: "string"
  649. password:
  650. type: "string"
  651. phone:
  652. type: "string"
  653. userStatus:
  654. type: "integer"
  655. format: "int32"
  656. description: "User Status"
  657. Tag:
  658. type: "object"
  659. properties:
  660. id:
  661. type: "integer"
  662. format: "int64"
  663. name:
  664. type: "string"
  665. xml:
  666. name: "Tag"
  667. Order:
  668. type: "object"
  669. required:
  670. - "name"
  671. - "photoUrls"
  672. properties:
  673. id:
  674. type: "integer"
  675. format: "int64"
  676. category:
  677. $ref: "#/definitions/Category"
  678. name:
  679. type: "string"
  680. example: "doggie"
  681. photoUrls:
  682. type: "array"
  683. xml:
  684. name: "photoUrl"
  685. wrapped: true
  686. items:
  687. type: "string"
  688. tags:
  689. type: "array"
  690. xml:
  691. name: "tag"
  692. wrapped: true
  693. items:
  694. $ref: "#/definitions/Tag"
  695. status:
  696. type: "string"
  697. description: "order status in the store"
  698. enum:
  699. - "available"
  700. - "pending"
  701. - "sold"
  702. ApiResponse:
  703. type: "object"
  704. properties:
  705. code:
  706. type: "integer"
  707. format: "int32"
  708. type:
  709. type: "string"
  710. message:
  711. type: "string"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement