From 7995bb9cf6392328c30138f05cf5b861d72c8583 Mon Sep 17 00:00:00 2001 From: Melchior Moulin Date: Tue, 23 Apr 2024 18:38:50 +0200 Subject: [PATCH] fix unmarshal json issue when setting user Context: https://github.com/onelogin/onelogin-go-sdk/issues/79 When setting UserQuery params GetUsers throw an error Failed to get user: json: cannot unmarshal string into Go value of type []string --- pkg/onelogin/utilities/web.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/onelogin/utilities/web.go b/pkg/onelogin/utilities/web.go index f6bf598..ea0aabb 100644 --- a/pkg/onelogin/utilities/web.go +++ b/pkg/onelogin/utilities/web.go @@ -108,10 +108,13 @@ func queryToValues(query interface{}) (url.Values, error) { if err != nil { return nil, err } - err = json.Unmarshal(queryBytes, &values) - if err != nil { + var data map[string]string + if err := json.Unmarshal(queryBytes, &data); err != nil { return nil, err } + for key, value := range data { + values.Set(key, value) + } } return values, nil