-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Allow RemoteSessionSettings to use any value for metadata
#14726
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
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.AddMetadataSettingmethod 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
JsonNodeandJsonElementfrom being used.Motivation and Context
Types of changes
Checklist
PR Type
Enhancement, Tests
Description
RemoteSessionSettingsto supportSystem.Text.Json.NodesandSystem.Text.Json.Elements.mustMatchDriverOptionsfield with a propertyMustMatchDriverOptionsfor better encapsulation.IsJsonSerializablemethod to handleJsonNodeandJsonElementtypes, and added null checks.RemoteSessionSettings, ensuring compatibility with various JSON serializable types.Changes walkthrough 📝
RemoteSessionSettings.cs
Enhance RemoteSessionSettings to support System.Text.Json typesdotnet/src/webdriver/Remote/RemoteSessionSettings.cs
System.Text.Json.NodesinRemoteSessionSettings.mustMatchDriverOptionswith a propertyMustMatchDriverOptions.IsJsonSerializablemethod to handleJsonNodeandJsonElement.IsJsonSerializable.RemoteSessionCreationTests.cs
Add tests for RemoteSessionSettings JSON compatibilitydotnet/test/remote/RemoteSessionCreationTests.cs
RemoteSessionSettingsmetadata settings.JsonNodeandJsonElement.