From 7a3c368121c1a1e29e6fcf469735feecb2f94d8f Mon Sep 17 00:00:00 2001 From: Hein Date: Tue, 2 Dec 2025 16:09:36 +0200 Subject: [PATCH] Pass through to default handler --- pkg/resolvespec/handler.go | 8 ++++---- pkg/restheadspec/handler.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/resolvespec/handler.go b/pkg/resolvespec/handler.go index 847d0e3..6c3853a 100644 --- a/pkg/resolvespec/handler.go +++ b/pkg/resolvespec/handler.go @@ -81,8 +81,8 @@ func (h *Handler) Handle(w common.ResponseWriter, r common.Request, params map[s // Get model and populate context with request-scoped data model, err := h.registry.GetModelByEntity(schema, entity) if err != nil { - logger.Error("Invalid entity: %v", err) - h.sendError(w, http.StatusBadRequest, "invalid_entity", "Invalid entity", err) + // Model not found - pass through to next route without writing response + logger.Debug("Model not found for %s.%s, passing through to next route", schema, entity) return } @@ -148,8 +148,8 @@ func (h *Handler) HandleGet(w common.ResponseWriter, r common.Request, params ma model, err := h.registry.GetModelByEntity(schema, entity) if err != nil { - logger.Error("Failed to get model: %v", err) - h.sendError(w, http.StatusBadRequest, "invalid_entity", "Invalid entity", err) + // Model not found - pass through to next route without writing response + logger.Debug("Model not found for %s.%s, passing through to next route", schema, entity) return } diff --git a/pkg/restheadspec/handler.go b/pkg/restheadspec/handler.go index 329e468..3b5080a 100644 --- a/pkg/restheadspec/handler.go +++ b/pkg/restheadspec/handler.go @@ -81,8 +81,8 @@ func (h *Handler) Handle(w common.ResponseWriter, r common.Request, params map[s // Get model and populate context with request-scoped data model, err := h.registry.GetModelByEntity(schema, entity) if err != nil { - logger.Error("Invalid entity: %v", err) - h.sendError(w, http.StatusBadRequest, "invalid_entity", "Invalid entity", err) + // Model not found - pass through to next route without writing response + logger.Debug("Model not found for %s.%s, passing through to next route", schema, entity) return } @@ -197,8 +197,8 @@ func (h *Handler) HandleGet(w common.ResponseWriter, r common.Request, params ma model, err := h.registry.GetModelByEntity(schema, entity) if err != nil { - logger.Error("Failed to get model: %v", err) - h.sendError(w, http.StatusBadRequest, "invalid_entity", "Invalid entity", err) + // Model not found - pass through to next route without writing response + logger.Debug("Model not found for %s.%s, passing through to next route", schema, entity) return }