From b72f202fccf0c3dda55772c748b4092f2ce88ca4 Mon Sep 17 00:00:00 2001 From: Samuel Mutel <12967891+smutel@users.noreply.github.com> Date: Fri, 30 Jun 2023 17:15:53 +0200 Subject: [PATCH] fix: Wrong conversion of filter name with underscore --- netbox/internal/util/util.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/netbox/internal/util/util.go b/netbox/internal/util/util.go index beb79e5a5..f9867ad6b 100644 --- a/netbox/internal/util/util.go +++ b/netbox/internal/util/util.go @@ -119,6 +119,14 @@ func FieldNameToStructName(k string) string { r := []rune(k) r[0] = unicode.ToUpper(r[0]) k = string(r) - k = strings.Replace(k, "_", "", -1) + + split := strings.Split(k, "_") + k = split[0] + if len(split) > 1 { + r2 := []rune(split[1]) + r2[0] = unicode.ToUpper(r2[0]) + k = k + string(r2) + } + return k }