Fixed linting

This commit is contained in:
Hein
2025-12-09 12:02:44 +02:00
parent d188f49126
commit 23e2db1496
4 changed files with 76 additions and 69 deletions

View File

@@ -22,12 +22,12 @@ type FallbackHandler func(w common.ResponseWriter, r common.Request, params map[
// Handler handles API requests using database and model abstractions
type Handler struct {
db common.Database
registry common.ModelRegistry
nestedProcessor *common.NestedCUDProcessor
hooks *HookRegistry
fallbackHandler FallbackHandler
openAPIGenerator func() (string, error)
db common.Database
registry common.ModelRegistry
nestedProcessor *common.NestedCUDProcessor
hooks *HookRegistry
fallbackHandler FallbackHandler
openAPIGenerator func() (string, error)
}
// NewHandler creates a new API handler with database and registry abstractions
@@ -1464,7 +1464,10 @@ func (h *Handler) HandleOpenAPI(w common.ResponseWriter, r common.Request) {
w.SetHeader("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
w.Write([]byte(spec))
_, err = w.Write([]byte(spec))
if err != nil {
logger.Error("Error sending OpenAPI spec response: %v", err)
}
}
// SetOpenAPIGenerator sets the OpenAPI generator function