-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Move JSON serialization methods into OrleansJsonSerializer #2206
Conversation
@@ -7,16 +7,25 @@ | |||
|
|||
namespace Orleans.Serialization | |||
{ | |||
internal class OrleansJsonSerializer : IExternalSerializer | |||
using Orleans.Providers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: please put using statements outside
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix my StyleCop settings. I think they're fairly close to the defaults.
ContainerNamePropertyName, | ||
"SerializeTypeNames", | ||
"PreserveReferencesHandling", | ||
OrleansJsonSerializer.UseFullAssemblyNamesProperty, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SerializeTypeNames and PreserveReferencesHandling are bogus, aren't they? we don't seem to be using them at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They seem to be bogus, I was considering removing them but wasn't 100% certain. I found no occurrences of those strings anywhere in our solution.
I'll nix them.
static OrleansJsonSerializer() | ||
{ | ||
defaultSettings = GetDefaultSerializerSettings(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the defaultSettings cached value is an old thing and we do not use it anymore. I'm not suggesting we should use it, because mutating this shared object is not expected but possible (and was causing sneaky side-effects, so that's why we stopped using it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got confused, I guess it's OK... It's not configurable now, but that's orthogonal to this PR, merging
This is a (minorly) breaking change which moves
GetDefaultJsonSerializerSettings
&UpdateSerializerSettings
out ofSerializationManager
and intoOrleansJsonSerializer
.It also makes
OrleansJsonSerializer
public so that external providers can reference it.