swagger.json 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "contact": {}
  5. },
  6. "paths": {
  7. "/api/files": {
  8. "get": {
  9. "description": "Get a list of all files in the cloud storage",
  10. "produces": [
  11. "application/json"
  12. ],
  13. "tags": [
  14. "files"
  15. ],
  16. "summary": "List all files",
  17. "responses": {
  18. "200": {
  19. "description": "OK",
  20. "schema": {
  21. "type": "array",
  22. "items": {
  23. "$ref": "#/definitions/model.File"
  24. }
  25. }
  26. }
  27. }
  28. },
  29. "post": {
  30. "description": "Upload a file to the cloud storage",
  31. "consumes": [
  32. "multipart/form-data"
  33. ],
  34. "produces": [
  35. "application/json"
  36. ],
  37. "tags": [
  38. "files"
  39. ],
  40. "summary": "Upload a file",
  41. "parameters": [
  42. {
  43. "type": "file",
  44. "description": "File to upload",
  45. "name": "file",
  46. "in": "formData",
  47. "required": true
  48. }
  49. ],
  50. "responses": {
  51. "200": {
  52. "description": "OK",
  53. "schema": {
  54. "$ref": "#/definitions/model.File"
  55. }
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "definitions": {
  62. "model.File": {
  63. "type": "object",
  64. "properties": {
  65. "created_at": {
  66. "type": "string"
  67. },
  68. "id": {
  69. "type": "integer"
  70. },
  71. "name": {
  72. "type": "string"
  73. },
  74. "path": {
  75. "type": "string"
  76. },
  77. "size": {
  78. "type": "integer"
  79. },
  80. "type": {
  81. "type": "string"
  82. },
  83. "updated_at": {
  84. "type": "string"
  85. }
  86. }
  87. }
  88. }
  89. }