-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Parse response before deserialization #15268
base: trunk
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
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.
This will parse the WebDriver response into its constituent parts before deserializing into an
object
Motivation and Context
This simplifies the handling, and prepares us to potentially expose the response as a
JsonNode
/JsonElement
in the futureTypes of changes
Checklist
PR Type
Enhancement
Description
Refactored
Response
class to useJsonNode
for parsing.Simplified JSON deserialization logic for better maintainability.
Improved error handling for JSON parsing in
FromJson
andFromErrorJson
.Updated
ResponseJsonSerializerContext
to include new serialization options.Changes walkthrough 📝
Response.cs
Refactor JSON parsing and deserialization in Response class
dotnet/src/webdriver/Response.cs
Dictionary
withJsonNode
for JSON parsing.FromJson
andFromErrorJson
methods for better error handling.JsonSourceGenerationOptions
toResponseJsonSerializerContext
.JsonSerializer.Deserialize
.