From a8c2c301f86b3718fee2430dbd8bc7b0f226cbfd Mon Sep 17 00:00:00 2001 From: Jeremy Mouton Date: Tue, 6 Jan 2026 14:19:32 +0100 Subject: [PATCH] fix: Skip path and query parameters in schema generation --- fiberoapi.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fiberoapi.go b/fiberoapi.go index 784c2d7..1ac5f71 100644 --- a/fiberoapi.go +++ b/fiberoapi.go @@ -575,6 +575,11 @@ func generateSchema(t reflect.Type) map[string]interface{} { continue } + // Skip fields that are path or query parameters - they are handled separately + if field.Tag.Get("path") != "" || field.Tag.Get("query") != "" { + continue + } + // Get JSON tag name jsonTag := field.Tag.Get("json") if jsonTag == "-" { @@ -602,13 +607,6 @@ func generateSchema(t reflect.Type) map[string]interface{} { } } - // Add description from path/query tags - if pathTag := field.Tag.Get("path"); pathTag != "" { - fieldSchema["description"] = "Path parameter: " + pathTag - } else if queryTag := field.Tag.Get("query"); queryTag != "" { - fieldSchema["description"] = "Query parameter: " + queryTag - } - properties[fieldName] = fieldSchema }