materialize-openapi.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. openapi: 3.0.3
  2. info:
  3. title: materialize
  4. version: 0.1.0
  5. paths:
  6. /api/sql:
  7. post:
  8. summary: execute sql statement(s)
  9. parameters:
  10. - in: query
  11. name: options
  12. schema:
  13. type: string
  14. description: |-
  15. A JSON object containing configuration parameters.
  16. A simple example:
  17. {"application_name":"example_app","cluster":"quickstart"}
  18. Refer to the documentation for all available configuration parameters:
  19. https://materialize.com/docs/sql/show/#other-configuration-parameters
  20. requestBody:
  21. content:
  22. application/json:
  23. schema:
  24. oneOf:
  25. - $ref: "#/components/schemas/SimpleRequest"
  26. - $ref: "#/components/schemas/ExtendedRequest"
  27. required: true
  28. responses:
  29. "200":
  30. description: Successful operation
  31. content:
  32. application/json:
  33. schema:
  34. $ref: "#/components/schemas/Response"
  35. "422":
  36. description: Invalid body or parameters
  37. content:
  38. text/plain:
  39. schema:
  40. type: string
  41. "400":
  42. description: Invalid sql supplied
  43. content:
  44. text/plain:
  45. schema:
  46. type: string
  47. security:
  48. - tokenAuth: []
  49. components:
  50. schemas:
  51. Response:
  52. type: object
  53. properties:
  54. results:
  55. type: object
  56. oneOf:
  57. - $ref: "#/components/schemas/ErrorResponse"
  58. - $ref: "#/components/schemas/NoticeResponse"
  59. - $ref: "#/components/schemas/QueryResponse"
  60. QueryResponse:
  61. type: object
  62. properties:
  63. tag:
  64. type: string
  65. rows:
  66. type: array
  67. items:
  68. type: object
  69. desc:
  70. type: array
  71. items:
  72. $ref: "#/components/schemas/Column"
  73. NoticeResponse:
  74. type: object
  75. properties:
  76. ok:
  77. type: string
  78. notices:
  79. type: array
  80. items:
  81. $ref: "#/components/schemas/Notice"
  82. ErrorResponse:
  83. type: object
  84. properties:
  85. error:
  86. type: string
  87. notices:
  88. type: array
  89. items:
  90. $ref: "#/components/schemas/Notice"
  91. Column:
  92. type: object
  93. properties:
  94. name:
  95. type: string
  96. type_oid:
  97. type: number
  98. format: u32
  99. type_len:
  100. type: number
  101. format: i16
  102. type_mod:
  103. type: number
  104. format: i32
  105. Error:
  106. type: object
  107. properties:
  108. message:
  109. type: string
  110. code:
  111. type: string
  112. detail:
  113. type: string
  114. nullable: true
  115. hint:
  116. type: string
  117. nullable: true
  118. Notice:
  119. type: object
  120. properties:
  121. message:
  122. type: string
  123. severity:
  124. type: string
  125. detail:
  126. type: string
  127. nullable: true
  128. hint:
  129. type: string
  130. nullable: true
  131. SimpleRequest:
  132. type: object
  133. properties:
  134. query:
  135. type: string
  136. Query:
  137. type: object
  138. properties:
  139. query:
  140. type: string
  141. params:
  142. type: array
  143. nullable: true
  144. items:
  145. nullable: true
  146. type: string
  147. ExtendedRequest:
  148. type: object
  149. properties:
  150. queries:
  151. type: array
  152. items:
  153. $ref: "#/components/schemas/Query"
  154. securitySchemes:
  155. tokenAuth:
  156. type: http
  157. scheme: bearer