-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't overwrite default serializer settings (#21) #27
Conversation
@robotdan This would also fix alot of issues we're currently having in our UserApi uSvc. as it cannot deserialize any object with a datetimeoffset that doesn't come from fusionauth, since we don't use unix timestamps anywhere. Could this be merged? It's a very small change with no effect to the usage of the client library. But with a very big positive impact for anyone using the library. Newtonsoft.Json is the most popular json library for C#. Very widely used. |
We already use Newtonsoft.Json in some of the other parts of this lib. I'm fine with that, but my question is does this require changes to fusionauth-client-builder? I don't believe so, based on this code search: https://github.com/FusionAuth/fusionauth-client-builder/search?q=DefaultRESTClient |
I'm not super familiar with how these clients are generated from the templates but I did have a quick look and it didn't seem like |
Thanks for the follow up @TruDan and @epbensimpson - we really appreciate your expertise since we (or at least I am) .Net dumb. If I understand correctly, the serialization settings we are configuring currently are changing the global default configuration for Newtonsoft so it affects any others users of this library in the same runtime? If that is the case, this would be a great change to make. If you can confirm the above, I am up for merging this PR. @epbensimpson is correct - this change is only in this repo, the template stuff in the client builder just uses this base rest client code. For reference, here are the related templates: |
I'll merge this - if anyone wants to confirm my comments here #27 (comment) that would be great! (just for my own knowledge) |
Correct - I discovered this issue as we had code that was relying on |
Thanks for the info @epbensimpson much appreciated. |
Fixes an issue described in #21 where
DefaultRESTClient
is settingJsonConvert.DefaultSettings
instead of supplying the settings directly to theSerializeObject
andDeserializeObject
calls.