-
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
Naming Conventions do not match .Net standards #21
Comments
Thanks for your feedback! I can't promise when the engineering team will have time to evaluate and prioritize this work, but I really appreciate the feedback. |
Ha.. yes. This is true. I think we do want to be as idiomatic as we can be in each client library we build to follow the norms and conventions for the language. My guess is that changing the namespace is a breaking change for anyone compiling against this library? |
Yes, but as long as all of the classes stay the same name, this shouldn't be too much of a problem. VisualStudio/JetBrains Rider (most used C# IDE's) will suggest "Import FusionAuthClient from X namespace?" then everyone will see that the namespace has changed. It shouldn't cause too much trouble for any developer |
Great, thanks @TruDan - really appreciate the feedback and suggestions. |
Hi there, I think this issue has two very distinct components.
|
Don't overwrite default serializer settings (#21)
It's worth noting here, I looked deep into this issue today, newtonsoft always uses the settings from DefaultSettings factory method, and even if you pass jsonSerializerSettings as the 2nd parameter however your passed on settings will be applied ontop of the default Tl:;Dr; all this issue does is reverse the control of the root settings to the developer and not the fusionauth library. So it is possible that settings the developer overrides on DefaultSettings will break json serialisation in fusionauth. To prevent that happening the key settings must be defined. I might try to make a PR for this, I can explain better in code :) C# is my native language, English 2nd |
Thanks for that great detail @TruDan - I merged #27.
This is not ideal I suppose, but this is probably better than the other way around. At least we can blame the developer for breaking us, instead of us breaking the developer.
This would be great, thanks for your contribution! |
@TruDan I think I see what you're saying, it's a bit annoying how that works :( Whether it's an issue may depend on whether those settings are Edit: Confirmed that any non-specified settings on |
I heard from a collegue today that actually if you don't use |
It's very clear you guys are Java developers. Lowercase properties, reverse-domain namespaces. To a .Net developer, this feels really gross to work with.
My recommendations are:
FusionAuth
instead ofio.fusionauth
new CamelCasePropertyNamesContractResolver()
DefaultRESTClient
, you override the default JsonConvert serializer settings with your own settings. This actually caused us problems because your handling of DateTimeOffset is different to our own API's (and only now by searching the source code, i found why we were experiencing issues). Please instead store your own instance of JsonSerializerSettings with your customizations, and reference this when serializing/deserializing JSON. I tend to make a helper class for this, so you can still keep the "JsonConvert" style. For an example, see here: https://github.com/kennyvv/Alex/blob/master/src/Alex.ResourcePackLib/Json/MCJsonConvert.csThe text was updated successfully, but these errors were encountered: