-
Notifications
You must be signed in to change notification settings - Fork 10.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
Allow the ability to specify custom JsonSerializerOptions #22317
Allow the ability to specify custom JsonSerializerOptions #22317
Conversation
Not that I have anything to say here but in my opinion the options parameter should come after the identifier. Also, it might be better to wait for the staff members to give a statement on #12685, they're probably talking about it soon (or have already). |
@StevenRasmussen Thanks very much for this! Sorry it's taken so long to get back to you on this. We've been so focused on completing .NET 5 for ages. We're definitely interested in accepting this change. The core concept of passing a per-invocation
I know it's been a long time since you started this PR. Are you still keen to finish it off so we could merge it? If not that's fine, as we could get someone on our team to do it instead (but there would be no specific ETA for that yet - we're too early in .NET 6 planning). Also CC @pranavkm who's worked on some JS interop pieces recently in case he has other design feedback. As a sidenote, I'm also interested in what we could do about calls coming in the other direction (JS to .NET). What would be nice is if the .NET code could receive a |
@SteveSandersonMS - Thanks for the feedback! I will work on rebasing and incorporating the changes as you suggest. Re ETE test coverage: I'll need some specific guidance on what you want here. Pointing to some existing tests that I could use as a starting point would be great. Thanks! |
…ication of JsonSerializerOptions per invocation.
…ing in JsonSerializerOptions.
2e2b8d6
to
f933879
Compare
@SteveSandersonMS - I've rebased and updated per your comments. I noticed that I wasn't sure if we should add overloads for each of the extension methods in the Re ETE testing: I looked at some of the tests and perhaps something similar to the |
Thanks for the updates on this. I've reviewed it and think this is a totally viable feature, so thanks for contributing it! There are some further changes that would be needed to this PR, though:
I know I'm asking a lot here. However this is the nature of making such a low-level change to a framework where back-compatibility and long-term maintainability are so vital. Please let me know if any of the above doesn't make sense! |
Sure:
|
Hi @StevenRasmussen. |
@StevenRasmussen This got off to an amazing start, it pains me to see that this ended up going nowhere! Is there an existing facility that provides these features at this time? If not, I hope someone can continue the work you started :-) |
Hi @user72356. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Allow the ability to specify custom JsonSerializerOptions when calling the
IJSInterop.InvokeAsync<T>
methods.Summary of the changes
IJSInterop.InvokeAsync<T>
methods that allow passing a custom JsonSerializerOptions object for both serialization and deserialization of the args and return value.Addresses #12685