Advertisement
Guest User

Untitled

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