You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

178 lines
6.1 KiB

  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "files_versions",
  5. "version": "0.0.1",
  6. "description": "This application automatically maintains older versions of files that are changed.",
  7. "license": {
  8. "name": "agpl"
  9. }
  10. },
  11. "components": {
  12. "securitySchemes": {
  13. "basic_auth": {
  14. "type": "http",
  15. "scheme": "basic"
  16. },
  17. "bearer_auth": {
  18. "type": "http",
  19. "scheme": "bearer"
  20. }
  21. },
  22. "schemas": {
  23. "Capabilities": {
  24. "type": "object",
  25. "required": [
  26. "files"
  27. ],
  28. "properties": {
  29. "files": {
  30. "type": "object",
  31. "required": [
  32. "versioning",
  33. "version_labeling",
  34. "version_deletion"
  35. ],
  36. "properties": {
  37. "versioning": {
  38. "type": "boolean"
  39. },
  40. "version_labeling": {
  41. "type": "boolean"
  42. },
  43. "version_deletion": {
  44. "type": "boolean"
  45. }
  46. }
  47. }
  48. }
  49. }
  50. }
  51. },
  52. "paths": {
  53. "/index.php/apps/files_versions/preview": {
  54. "get": {
  55. "operationId": "preview-get-preview",
  56. "summary": "Get the preview for a file version",
  57. "tags": [
  58. "preview"
  59. ],
  60. "security": [
  61. {
  62. "bearer_auth": []
  63. },
  64. {
  65. "basic_auth": []
  66. }
  67. ],
  68. "parameters": [
  69. {
  70. "name": "file",
  71. "in": "query",
  72. "description": "Path of the file",
  73. "schema": {
  74. "type": "string",
  75. "default": ""
  76. }
  77. },
  78. {
  79. "name": "x",
  80. "in": "query",
  81. "description": "Width of the preview",
  82. "schema": {
  83. "type": "integer",
  84. "format": "int64",
  85. "default": 44
  86. }
  87. },
  88. {
  89. "name": "y",
  90. "in": "query",
  91. "description": "Height of the preview",
  92. "schema": {
  93. "type": "integer",
  94. "format": "int64",
  95. "default": 44
  96. }
  97. },
  98. {
  99. "name": "version",
  100. "in": "query",
  101. "description": "Version of the file to get the preview for",
  102. "schema": {
  103. "type": "string",
  104. "default": ""
  105. }
  106. },
  107. {
  108. "name": "mimeFallback",
  109. "in": "query",
  110. "description": "Whether to fallback to the mime icon if no preview is available",
  111. "schema": {
  112. "type": "boolean",
  113. "default": false
  114. }
  115. }
  116. ],
  117. "responses": {
  118. "200": {
  119. "description": "Preview returned",
  120. "content": {
  121. "*/*": {
  122. "schema": {
  123. "type": "string",
  124. "format": "binary"
  125. }
  126. }
  127. }
  128. },
  129. "400": {
  130. "description": "Getting preview is not possible",
  131. "content": {
  132. "application/json": {
  133. "schema": {}
  134. }
  135. }
  136. },
  137. "404": {
  138. "description": "Preview not found",
  139. "content": {
  140. "application/json": {
  141. "schema": {}
  142. }
  143. }
  144. },
  145. "303": {
  146. "description": "Redirect to the mime icon url if mimeFallback is true",
  147. "headers": {
  148. "Location": {
  149. "schema": {
  150. "type": "string"
  151. }
  152. }
  153. }
  154. },
  155. "401": {
  156. "description": "Current user is not logged in",
  157. "content": {
  158. "application/json": {
  159. "schema": {
  160. "type": "object",
  161. "required": [
  162. "message"
  163. ],
  164. "properties": {
  165. "message": {
  166. "type": "string"
  167. }
  168. }
  169. }
  170. }
  171. }
  172. }
  173. }
  174. }
  175. }
  176. },
  177. "tags": []
  178. }