From 28f7a7996782f393d990133f9aa46099ab19c616 Mon Sep 17 00:00:00 2001 From: Nathan Perriolat Date: Fri, 14 Jun 2024 16:15:22 +0200 Subject: [PATCH] support ignore field on root query struct --- builder/query.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builder/query.go b/builder/query.go index 37d21fe..073b065 100644 --- a/builder/query.go +++ b/builder/query.go @@ -30,8 +30,13 @@ func (b *Builder) generateQueryParametersDoc(ctx context.Context, swagger *opena if err != nil { return err } + parsedTag := schema.ParseJsonTag(field) - name := schema.ParseJsonTag(field).Name + if parsedTag.Ignored != nil && *parsedTag.Ignored { + continue + } + + name := parsedTag.Name if name == field.Name { name = shared.ToSnakeCase(field.Name) }