You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using github.com/kong/go-kong v0.16.0 but i realized the same would occur with the latest version.
We are using API Keys and JWT and we are using the TAGS option to add some labels to our customer keys. I realized i cannot remove all TAGs added to a key through either KeyAuths.Update or JWTAuths.Update functions, even when we explicit pass an empty slice/array to both structs credentials/KeyAuth and credentials/JWTAuth in the Tags field.
Currently, both structs have Tags defined as follow:
In the otther hand, by calling Kong's API directly (PATCH to consumers/{USERNAME_OR_ID}/key-auth/{CRED_ID}) i could remove all tags passing either empty array or null value in the body.
Possible solution tested
I modified Kong's structs and I removed the omitempty annotation from the struct and i realized it worked for me.
Question
Do you have other option to remove all tags or changing the struct annotation is the only option?
As we need to fix that quickly, i'm gonna fork your repo and remove the omitempty. Could I open a PR with that change?
The text was updated successfully, but these errors were encountered:
Issue Description
We are using
github.com/kong/go-kong v0.16.0
but i realized the same would occur with the latest version.We are using API Keys and JWT and we are using the TAGS option to add some labels to our customer keys. I realized i cannot remove all TAGs added to a key through either KeyAuths.Update or JWTAuths.Update functions, even when we explicit pass an empty slice/array to both structs credentials/KeyAuth and credentials/JWTAuth in the Tags field.
Currently, both structs have Tags defined as follow:
They have the
omitempty
annotation which make empty Tags slice to be discarded when marshaled to json.I tested with following values no one worked to remove all tags:
In the otther hand, by calling Kong's API directly (PATCH to consumers/{USERNAME_OR_ID}/key-auth/{CRED_ID}) i could remove all tags passing either empty array or null value in the body.
Possible solution tested
I modified Kong's structs and I removed the
omitempty
annotation from the struct and i realized it worked for me.Question
Do you have other option to remove all tags or changing the struct annotation is the only option?
As we need to fix that quickly, i'm gonna fork your repo and remove the omitempty. Could I open a PR with that change?
The text was updated successfully, but these errors were encountered: