From 3b8de5be3bcc128c8a8250a8091cd1a554a9716b Mon Sep 17 00:00:00 2001 From: Ben McDonald Date: Fri, 7 Nov 2025 08:55:01 -0800 Subject: [PATCH 1/2] Add support back for routing to old parseRedfishEndpoints when no schema present Signed-off-by: Ben McDonald --- cmd/smd/smd-api.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/smd/smd-api.go b/cmd/smd/smd-api.go index a4b1975..2e437b5 100644 --- a/cmd/smd/smd-api.go +++ b/cmd/smd/smd-api.go @@ -2693,12 +2693,20 @@ func (s *SmD) doRedfishEndpointsPost(w http.ResponseWriter, r *http.Request) { } else { if s.openchami { s.lg.Printf("Payload does not contain PDUInventory key, routing to default V2 parser.") - if s.getSchemaVersion(w, body) > 0 { // Simplified from original + schemaVersion := s.getSchemaVersion(w, body) + if schemaVersion > 0 { err = s.parseRedfishEndpointDataV2(w, body, false) if err != nil { sendJsonError(w, http.StatusInternalServerError, fmt.Sprintf("failed parsing post data (V2): %v", err)) } + } else {- + // This routes legacy requests (schemaVersion <= 0) to the old parser + err = s.parseRedfishEndpointData(w, eps, body) + if err != nil { + sendJsonError(w, http.StatusInternalServerError, + fmt.Sprintf("failed parsing post data: %v", err)) + } } } } From 19cb7df0f639a363110fd6f9411b2b4de232d27b Mon Sep 17 00:00:00 2001 From: Ben McDonald Date: Fri, 7 Nov 2025 09:09:15 -0800 Subject: [PATCH 2/2] Remove typo Signed-off-by: Ben McDonald --- cmd/smd/smd-api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/smd/smd-api.go b/cmd/smd/smd-api.go index 2e437b5..4b13a68 100644 --- a/cmd/smd/smd-api.go +++ b/cmd/smd/smd-api.go @@ -2700,7 +2700,7 @@ func (s *SmD) doRedfishEndpointsPost(w http.ResponseWriter, r *http.Request) { sendJsonError(w, http.StatusInternalServerError, fmt.Sprintf("failed parsing post data (V2): %v", err)) } - } else {- + } else { // This routes legacy requests (schemaVersion <= 0) to the old parser err = s.parseRedfishEndpointData(w, eps, body) if err != nil {