-
-
Notifications
You must be signed in to change notification settings - Fork 8.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
[dotnet] Add reflection-based JSON serialization fallback to Command
s
#14732
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
This is very good! Nice catch! |
In the short-term, this should stop all the JSON failures people may be having. In the long-term, this defeats some the purpose of source-generation. It's still faster, better, future-proof, etc. but it makes the AOT support "best effort". Instead, we may need separate overloads for the methods that take We can also add an extra parameter of Either way, the |
Short-term: this PR is very good for regular users (99%), for AOT let's review each particular case (if it happens). |
AOT is music to my ears :) One day this project can have the I made another small PR as part of incremental progress #14733 |
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.
Very good drug from headache!
User description
Fixes #14731
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Adds a reflection-based JSON serialization fallback, preventing unchecked exceptions from breaking scenarios.
Motivation and Context
Exceptions are being thrown for unknown types, including anonymous types.
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
Command
class to handle unknown types, including anonymous types, preventing unchecked exceptions.CommandJsonSerializerContext.Default
withDefaultJsonTypeInfoResolver
.Command
class, ensuring robustness and correctness.Changes walkthrough 📝
Command.cs
Add reflection-based JSON serialization fallback in Command class
dotnet/src/webdriver/Command.cs
JsonTypeInfoResolver.Combine
to JSON serializer options.DefaultJsonTypeInfoResolver
for enhanced serialization.CommandTests.cs
Add tests for JSON serialization of Command class
dotnet/test/common/CommandTests.cs
CommandTests
.