Skip to content

Commit

Permalink
Change swagger BinaryResponse to os.File
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Oct 16, 2023
1 parent e72dd8d commit 4c3e073
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion server/apiv1/swagger.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package apiv1

import "os"

// These structs are for the purpose of defining swagger HTTP responses

// Application information
Expand Down Expand Up @@ -146,7 +148,10 @@ type linkCheckParams struct {

// Binary data response inherits the attachment's content type
// swagger:response BinaryResponse
type binaryResponse string
type binaryResponse struct {
// in: body
File os.File
}

// Plain text response
// swagger:response TextResponse
Expand Down
7 changes: 6 additions & 1 deletion server/ui/api/v1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,11 @@
"x-go-name": "deleteMessagesRequestBody",
"x-go-package": "github.com/axllent/mailpit/server/apiv1"
},
"File": {
"type": "object",
"title": "File represents an open file descriptor.",
"x-go-package": "os"
},
"HTMLCheckResponse": {
"description": "Response represents the HTML check response struct",
"type": "object",
Expand Down Expand Up @@ -1382,7 +1387,7 @@
"BinaryResponse": {
"description": "Binary data response inherits the attachment's content type",
"schema": {
"type": "string"
"$ref": "#/definitions/File"
}
},
"ErrorResponse": {
Expand Down

0 comments on commit 4c3e073

Please sign in to comment.