1
0
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:
Ralph Slooten
2025-06-22 15:03:55 +12:00
parent f99d9ecf69
commit e29883fa1c
18 changed files with 906 additions and 934 deletions

View File

@@ -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 {