Closed CodeDrivenMitch closed 1 year ago
Hey @CodeDrivenMitch, thanks for raising this. As you noticed, because the domain objects like User
are not request-specific (i.e., we don't have a CreateUserRequest
or UpdateUserRequest
), issues like you encountered can happen. In a future version of the library we may do just that, and separate the body objects based on requests. That would be a big change, however, so for now what you can do is create a new User
like you mentioned, but you shouldn't need to copy all the attributes. Just set the fields you want updated; any fields that aren't changing can be ommitted. I know it's not ideal but others have found doing that to not be too onerous. Perhaps we can look into a way to create the separation in the short-term without creating all new body types, just not sure how that would work in the short-term.
Checklist
Description
I want to update the user's name and some additional information from the backend. For this, I use this SDK.
Unfortunately, the auth0 API no longer accepts attributes that it will not update. Retrieving a user, modifying some fields and then saving it will not work because of this. This is the reported error:
In addition, the fields mentioned by the error can not be cleared, as there are no setters.
Reproduction
Additional context
It would be possible to work around this by creating a new user, copying ALL attributes manually, and then posting it. This does not seem desireable to me, however.
auth0-java version
2.4.0
Java version
17