6540.yaml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. openapi: 3.0.0
  2. info:
  3. description: Test API
  4. version: v1
  5. title: Test API
  6. tags:
  7. - name: Test
  8. description: Test API
  9. servers:
  10. - url: /v1
  11. paths:
  12. /test:
  13. post:
  14. tags:
  15. - Test
  16. summary: Test endpoint
  17. description: Test
  18. operationId: postTest
  19. responses:
  20. '200':
  21. description: Returns response
  22. content:
  23. application/xml:
  24. schema:
  25. $ref: '#/components/schemas/test'
  26. components:
  27. schemas:
  28. test:
  29. type: object
  30. properties:
  31. a:
  32. type: string
  33. b:
  34. type: integer
  35. c:
  36. type: array
  37. items:
  38. $ref: '#/components/schemas/Things'
  39. d:
  40. type: array
  41. items:
  42. anyOf:
  43. - $ref: '#/components/schemas/TextObject'
  44. - $ref: '#/components/schemas/ImageObject'
  45. Things:
  46. type: object
  47. oneOf:
  48. - $ref: '#/components/schemas/TextObject'
  49. - $ref: '#/components/schemas/ImageObject'
  50. TextObject:
  51. required:
  52. - data
  53. type: object
  54. properties:
  55. objectType:
  56. type: string
  57. example: Text
  58. xml:
  59. name: ObjectType
  60. data:
  61. type: string
  62. example: This is a text
  63. xml:
  64. name: Data
  65. description: Contains a text
  66. ImageObject:
  67. required:
  68. - data
  69. type: object
  70. properties:
  71. objectType:
  72. type: string
  73. example: image
  74. xml:
  75. name: ObjectType
  76. data:
  77. type: string
  78. example: This is a image
  79. xml:
  80. name: Data
  81. description: Contains a image