swagger.json 2.6 KB

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