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
{{ message }}
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.
All of the structs in this codebase uses pointers instead of primitives. I assume this was because the JSON option omitempty would omit empty values (false, 0, empty string) from being serialized, preventing the library from being able to sending empty values to Auth0.
The one exception to the all pointer convention is lists. Lists in the structs are actual lists, []interface{}, instead of pointer to lists, *[]interface{}. This makes it impossible to send an empty list to auth0.
I dont know the full impact on changing all lists to be pointer to lists, or updating all lists to remove the omitempty tag, but something has got to give as currently its impossible to send an empty list.
The text was updated successfully, but these errors were encountered:
Look like in #29 there was a one-off to remove omitempty from the scope list, which got merged. And another one-off at #43 to remove omitempty from the client struct, which hasnt merged yet. Some good discussion in that last PR; looks like this is an already know issue without a solution yet.
Whatever solution we go with, it should be applied to all lists in all structs and not be one-off solutions.
I agree Stephen, we should indeed be consistent with all these. For what its worth the reason why I agreed to merge #29 was due to it being required in POST and PATCH requests.
The thing is, I haven't seen another SDK use pointers for slices and maps so far, and I suspect there's a good reason for that. Also, the added complexity of slices and maps having arbitrary types, it would make helper methods impossible to implement (e.g. the slice equivalent of auth0.String(...)).
Closing this as there is no plan to tackle this particular use case directly in the SDK. But, using the newly exposed Request & co methods you should be able to send any custom payload to the management API to overcome this issue.
All of the structs in this codebase uses pointers instead of primitives. I assume this was because the JSON option
omitempty
would omit empty values (false, 0, empty string) from being serialized, preventing the library from being able to sending empty values to Auth0.The one exception to the all pointer convention is lists. Lists in the structs are actual lists,
[]interface{}
, instead of pointer to lists,*[]interface{}
. This makes it impossible to send an empty list to auth0.I dont know the full impact on changing all lists to be pointer to lists, or updating all lists to remove the
omitempty
tag, but something has got to give as currently its impossible to send an empty list.The text was updated successfully, but these errors were encountered: