Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. swagger: '2.0'
  2. info:
  3. description: API for parcel tracking
  4. version: 1.0.0
  5. title: Package Aggregator API
  6. contact:
  7.  
  8. license:
  9. name: MIT License
  10. url: https://opensource.org/licenses/MIT
  11.  
  12. # tags are used for organizing operations
  13. tags:
  14. - name: service
  15. description: API available to regular businesses
  16.  
  17. paths:
  18. /test:
  19. get:
  20. tags:
  21. - service
  22. summary: test route for get requests
  23. operationId: testGet
  24. description: |
  25. By passing in the appropriate options, you can search for
  26. available inventory in the system
  27. produces:
  28. - application/json
  29. parameters:
  30. - in: query
  31. name: querystring
  32. description: pass a querystring to test your request
  33. required: true
  34. type: string
  35. responses:
  36. 200:
  37. description: Request OK
  38. schema:
  39. $ref: '#/definitions/TestQueryString'
  40. 400:
  41. description: querystring missing
  42. post:
  43. tags:
  44. - service
  45. summary: test route for post requests
  46. operationId: testPost
  47. description: pass a json payload to test your request
  48. consumes:
  49. - application/json
  50. produces:
  51. - application/json
  52. parameters:
  53. - in: body
  54. name: payload
  55. description: correct payload(json)
  56. required: true
  57. schema:
  58. type: object
  59. example: {
  60. "key1":"value1",
  61. "key2":"value2"
  62. }
  63. responses:
  64. 200:
  65. description: Request OK
  66. schema:
  67. type: object
  68. example: {
  69. "key1":"value1",
  70. "key2":"value2"
  71. }
  72. 400:
  73. description: Invalid input, object invalid
  74. /track:
  75. get:
  76. tags:
  77. - service
  78. summary: get tracking information for a shipping number
  79. operationId: searchParcel
  80. description: |
  81. By passing in the tracking number and company code, fetch the shipment status
  82. produces:
  83. - application/json
  84. parameters:
  85. - in: query
  86. name: trackingnum
  87. description: Shipment tracking number ranging from 8 to 12 digits given by the courier
  88. required: true
  89. type: string
  90. - in: query
  91. name: companycode
  92. description: Alphabet code for courier identification. ( CJ - 대한통운, KPOST - 우체국 )
  93. required: true
  94. type: string
  95. responses:
  96. 200:
  97. description: Request OK
  98. schema:
  99. type: object
  100. example:
  101. $ref: '#/definitions/TrackDataModel'
  102. 400:
  103. description: Bad Request
  104. 404:
  105. description: Not Found(Parcel Server down)
  106. 418:
  107. description: I'm a teapot
  108. definitions:
  109. TestQueryString:
  110. type: object
  111. required:
  112. - querystring
  113. properties:
  114. querystring:
  115. type: string
  116. example: random_sentence
  117. TrackDataModel:
  118. type: object
  119. required:
  120. - trackingnum
  121. - sender
  122. - receiver
  123. - status
  124. - history
  125. properties:
  126. trackingnum:
  127. type: string
  128. example: "6069508189467"
  129. sender:
  130. type: string
  131. example: "엘지 홈**"
  132. receiver:
  133. type: string
  134. example: "김승*"
  135. status:
  136. type: string
  137. example: "간선하차"
  138. history:
  139. type: array
  140. items:
  141. type: object
  142. properties:
  143. date:
  144. type: string
  145. time:
  146. type: string
  147. location:
  148. type: string
  149. note:
  150. type: string
  151. example:
  152. - date: "2017-11-24"
  153. time: "13:52"
  154. location: "대구 하차장"
  155. note: "배달완료"
  156. - date: "2017-10-11"
  157. time: "04:25"
  158. location: "서울"
  159. note: "배달준비"
  160.  
  161. # Added by API Auto Mocking Plugin
  162. host: virtserver.swaggerhub.com
  163. basePath: /gyuhyeon5/PackageAggregator/1.0.0
  164. # schemes:
  165. # - http
  166. # Added by API Auto Mocking Plugin
  167. # schemes:
  168. # - http
  169. # Added by API Auto Mocking Plugin
  170. schemes:
  171. - https
  172. - http
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement