example.openapi.yaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. openapi: 3.0.0
  2. servers:
  3. - url: http://example.com/v1
  4. description: Production server version 1
  5. - url: http://staging-api.example.com
  6. description: Staging server
  7. info:
  8. description: |
  9. This is an API documentation of example.
  10. version: "0.1.0"
  11. title: Example
  12. termsOfService: 'http://www.example.com/terms/'
  13. contact:
  14. email: developer@example.com
  15. license:
  16. name: Proprietary license
  17. url: 'http://www.example.com/license/'
  18. tags:
  19. - name: agent
  20. description: Access to example
  21. paths:
  22. /agents/{agentId}:
  23. put:
  24. tags:
  25. - agent
  26. summary: Edit agent
  27. operationId: editAgent
  28. parameters:
  29. - in: path
  30. name: agentId
  31. schema:
  32. type: integer
  33. example: 12345
  34. required: true
  35. description: Numeric ID of the paper agent to edit
  36. requestBody:
  37. required: true
  38. content:
  39. application/json_media-type-level:
  40. schema:
  41. type: object
  42. properties:
  43. code:
  44. type: string
  45. name:
  46. type: string
  47. example:
  48. code: AE1
  49. name: Andrew
  50. application/json_schema-level:
  51. schema:
  52. type: object
  53. properties:
  54. code:
  55. type: string
  56. name:
  57. type: string
  58. example:
  59. code: AE1
  60. name: Andrew
  61. application/json_property-level:
  62. schema:
  63. type: object
  64. properties:
  65. code:
  66. type: string
  67. example: AE1
  68. name:
  69. type: string
  70. example: Andrew
  71. responses:
  72. '200':
  73. description: media type-level example
  74. content:
  75. application/json:
  76. schema:
  77. type: object
  78. properties:
  79. code:
  80. type: integer
  81. format: int64
  82. payload:
  83. type: array
  84. items:
  85. type: object
  86. properties:
  87. id:
  88. type: integer
  89. format: int64
  90. readOnly: true
  91. code:
  92. type: string
  93. name:
  94. type: string
  95. example:
  96. code: 200
  97. payload:
  98. - id: 1
  99. code: AE2
  100. name: Yono
  101. '201':
  102. description: schema-level example
  103. content:
  104. application/json:
  105. schema:
  106. type: object
  107. properties:
  108. code:
  109. type: integer
  110. format: int64
  111. payload:
  112. type: array
  113. items:
  114. type: object
  115. properties:
  116. id:
  117. type: integer
  118. format: int64
  119. readOnly: true
  120. code:
  121. type: string
  122. name:
  123. type: string
  124. example:
  125. code: 201
  126. payload:
  127. - id: 1
  128. code: AE2
  129. name: Yono
  130. '202':
  131. description: property-level example
  132. content:
  133. application/json:
  134. schema:
  135. type: object
  136. properties:
  137. code:
  138. type: integer
  139. format: int64
  140. example: 202
  141. payload:
  142. type: array
  143. items:
  144. type: object
  145. properties:
  146. id:
  147. type: integer
  148. format: int64
  149. readOnly: true
  150. example: 1
  151. code:
  152. type: string
  153. example: AE2
  154. name:
  155. type: string
  156. example: Yono