zhemant

multipart yaml

Mar 25th, 2019
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. openapi: 3.0.0
  2.  
  3. info:
  4. version: '1.0.0'
  5. title: 'session'
  6. description: 'Service'
  7.  
  8. externalDocs:
  9. description: document
  10. url: https://example.com
  11.  
  12. servers:
  13. - url: 'https:///127.0.0.1:8080/v1'
  14. variables:
  15. apiRoot:
  16. default: https://example.com
  17.  
  18. security:
  19. - {}
  20. - oAuth2ClientCredentials:
  21. - session
  22.  
  23. paths:
  24. /service:
  25. post:
  26. summary: Create service
  27. tags:
  28. - service collection
  29. operationId: PostService
  30. requestBody:
  31. description: service post
  32. required: true
  33. content:
  34. application/json: # message without binary body part
  35. schema:
  36. $ref: '#/components/schemas/ServiceCreateData'
  37. multipart/related:
  38. schema:
  39. type: object
  40. properties: # Request parts
  41. jsonData:
  42. $ref: '#/components/schemas/ServiceCreateData'
  43. binaryData:
  44. type: string
  45. format: binary
  46. encoding:
  47. jsonData:
  48. contentType: application/json
  49. binaryData:
  50. contentType: application/octet
  51. headers:
  52. Content-Id:
  53. schema:
  54. type: string
  55.  
  56. responses:
  57. '201':
  58. description: successful creation of an service
  59. content:
  60. application/json: # message without binary body part
  61. schema:
  62. $ref: '#/components/schemas/ServiceData'
  63. multipart/related: # message with binary body part(s)
  64. schema:
  65. type: object
  66. properties: # Request parts
  67. jsonData:
  68. $ref: '#/components/schemas/ServiceData'
  69. binaryData:
  70. type: string
  71. format: binary
  72. encoding:
  73. jsonData:
  74. contentType: application/json
  75. binaryData:
  76. contentType: application/octet
  77. headers:
  78. Content-Id:
  79. schema:
  80. type: string
  81. headers:
  82. Location:
  83. required: true
  84. schema:
  85. type: string
  86. components:
  87. schemas:
  88. #
  89. # STRUCTURED DATA TYPES
  90. #
  91. ServiceCreateData:
  92. type: object
  93. properties:
  94. code:
  95. type: integer
  96. format: int32
  97. type:
  98. type: string
  99. message:
  100. type: string
  101.  
  102. ServiceData:
  103. type: object
  104. properties:
  105. code:
  106. type: integer
  107. format: int32
  108. type:
  109. type: string
  110. message:
  111. type: string
Add Comment
Please, Sign In to add comment