-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Changing msgpack options #20031
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
Changing msgpack options #20031
Changes from all commits
3587eec
3b0d679
7ff6c3b
71b7aeb
75a3406
0b2dd88
62fa142
2a433a8
1ce3786
b0a3284
5188f5c
e4217c6
de9e7a7
38b9369
96095a7
f3fdbdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,24 +9,31 @@ namespace Microsoft.AspNetCore.SignalR | |
{ | ||
public class MessagePackHubProtocolOptions | ||
{ | ||
private IList<IFormatterResolver> _formatterResolvers; | ||
private MessagePackSerializerOptions _messagePackSerializerOptions; | ||
|
||
public IList<IFormatterResolver> FormatterResolvers | ||
/// <summary> | ||
/// <para>Gets or sets the <see cref="MessagePackSerializerOptions"/> used internally by the <see cref="MessagePackSerializer" />.</para> | ||
/// <para>If you override the default value, we strongly recommend that you set <see cref="MessagePackSecurity" /> to <see cref="MessagePackSecurity.UntrustedData"/> by calling:</para> | ||
/// <code>customMessagePackSerializerOptions = customMessagePackSerializerOptions.WithSecurity(MessagePackSecurity.UntrustedData)</code> | ||
tebeco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// If you modify the default options you must also assign the updated options back to the <see cref="SerializerOptions" /> property: | ||
/// <code>options.SerializerOptions = options.SerializerOptions.WithResolver(new CustomResolver());</code> | ||
tebeco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// </summary> | ||
public MessagePackSerializerOptions SerializerOptions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets add xml comments.
SerializerOptions = SerializerOptions.WithResolver(new CustomResolver()); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. quick question, as the API has been approuved, and thinking about the summary, i have a terrible idea.... (i have no idea if it's possible) but does adding this makes sense:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as said it just something that crossed my mind while trying to find an idea for the summary (TBH I'm pretty bad at it) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (previous rendering deleted) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. welllll There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. Yep, drop the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (done, do i mark this thread as resolved if summary if ok for you ?) |
||
{ | ||
get | ||
{ | ||
if (_formatterResolvers == null) | ||
if (_messagePackSerializerOptions == null) | ||
{ | ||
// The default set of resolvers trigger a static constructor that throws on AOT environments. | ||
// This gives users the chance to use an AOT friendly formatter. | ||
_formatterResolvers = MessagePackHubProtocol.CreateDefaultFormatterResolvers(); | ||
_messagePackSerializerOptions = MessagePackHubProtocol.CreateDefaultMessagePackSerializerOptions(); | ||
} | ||
|
||
return _formatterResolvers; | ||
return _messagePackSerializerOptions; | ||
} | ||
set | ||
{ | ||
_formatterResolvers = value; | ||
_messagePackSerializerOptions = value; | ||
} | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.