-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Obsolete setters and constructors on Response that are not conducive to immutability
#15107
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
nvborisenko
left a comment
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.
Thx, it is way to improve.
… conducive to immutability (SeleniumHQ#15107) * [dotnet] Obsoletes setters on `Response` type * [dotnet] Obsolete constructors on `Response` that are not conducive to immutability * Avoid obsolete `Response` constructor
… conducive to immutability (SeleniumHQ#15107) * [dotnet] Obsoletes setters on `Response` type * [dotnet] Obsolete constructors on `Response` that are not conducive to immutability * Avoid obsolete `Response` constructor
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.
Description
Obsolete every constructor on
Responsebesides the one which sets all values. Obsolete public setters onResponseproperties.Motivation and Context
A programmatic guarantee of immutability would be a conceptual simplification, because it allows us to make assumptions and guarantees we could not otherwise make.
For example, in the future we could expose
JsonNode? ValueAsNodeproperty which would allow us to manage the response as a strongly-typed node instead of knowing ahead of time what the types could be.Types of changes
Checklist
PR Type
Enhancement, Other
Description
Marked constructors and setters in
Responseas obsolete.Introduced warnings for deprecated
Responsemembers.Updated
HttpCommandExecutorto handle obsoleteResponse.Valuesetter.Prepared
Responseclass for immutability in future releases.Changes walkthrough 📝
HttpCommandExecutor.cs
Suppress warnings for obsolete `Response.Value` setterdotnet/src/webdriver/Remote/HttpCommandExecutor.cs
Response.Valuesetter.CreateResponsemethod to handle deprecatedResponse.Value.Response.cs
Mark `Response` constructors and setters as obsoletedotnet/src/webdriver/Response.cs
Value,SessionId, andStatusas obsolete.