-
-
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] Allow RemoteSessionSettings
to use any value for metadata
#14726
[dotnet] Allow RemoteSessionSettings
to use any value for metadata
#14726
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
RemoteSessionSettings
to use System.Text.Json valuesRemoteSessionSettings
to use any value for metadata
Can you please adjust PR description according to the latest changes? Thx. |
PR description updated, |
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.
Thank you!
User description
Fixes #14725
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
The
RemoteSessionSettings.AddMetadataSetting
method only allows users to pass in "primitive" types.This is not necessary, as any type that can be serialized to JSON is valid. If a type is somehow not JSON-serializable, then the proper exception will be thrown by the serializer.. It also restricts the use of JSON primitives such as
JsonNode
andJsonElement
from being used.Motivation and Context
Types of changes
Checklist
PR Type
Enhancement, Tests
Description
RemoteSessionSettings
to supportSystem.Text.Json.Nodes
andSystem.Text.Json.Elements
.mustMatchDriverOptions
field with a propertyMustMatchDriverOptions
for better encapsulation.IsJsonSerializable
method to handleJsonNode
andJsonElement
types, and added null checks.RemoteSessionSettings
, ensuring compatibility with various JSON serializable types.Changes walkthrough 📝
RemoteSessionSettings.cs
Enhance RemoteSessionSettings to support System.Text.Json types
dotnet/src/webdriver/Remote/RemoteSessionSettings.cs
System.Text.Json.Nodes
inRemoteSessionSettings
.mustMatchDriverOptions
with a propertyMustMatchDriverOptions
.IsJsonSerializable
method to handleJsonNode
andJsonElement
.IsJsonSerializable
.RemoteSessionCreationTests.cs
Add tests for RemoteSessionSettings JSON compatibility
dotnet/test/remote/RemoteSessionCreationTests.cs
RemoteSessionSettings
metadata settings.JsonNode
andJsonElement
.