mirror of
https://github.com/axllent/mailpit.git
synced 2025-12-24 00:22:27 +02:00
Chore: Refactor API Swagger definitions and remove unused structs
- Removed deprecated `thumbnailParams` struct from `thumbnails.go`. - Updated `server_test.go` to use an anonymous struct for response unmarshalling. - Enhanced `swagger.json` with detailed definitions for SendRequest and SendMessageResponse. - Introduced new `swaggerParams.go` to define Swagger parameters for various API endpoints. - Created `swaggerResponses.go` to define Swagger responses for API endpoints. - Cleaned up unused JSON error message definitions and consolidated error responses. - Improved documentation for Chaos triggers and web UI configuration responses.
This commit is contained in:
@@ -35,9 +35,7 @@ func httpJSONError(w http.ResponseWriter, msg string) {
|
||||
w.Header().Set("Referrer-Policy", "no-referrer")
|
||||
w.Header().Set("Content-Security-Policy", config.ContentSecurityPolicy)
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
e := JSONErrorMessage{
|
||||
Error: msg,
|
||||
}
|
||||
e := struct{ Error string }{Error: msg}
|
||||
|
||||
w.Header().Add("Content-Type", "application/json")
|
||||
if err := json.NewEncoder(w).Encode(e); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user