Skip to content

Upgrade RestSharp from 106.15.0 to 114.0.0#235

Merged
weppos merged 1 commit into
mainfrom
restsharp-114-migration
Apr 16, 2026
Merged

Upgrade RestSharp from 106.15.0 to 114.0.0#235
weppos merged 1 commit into
mainfrom
restsharp-114-migration

Conversation

@weppos

@weppos weppos commented Apr 16, 2026

Copy link
Copy Markdown
Member

RestSharp 106.15.0 was released in 2021. We deferred the upgrade for so long that the dependency has since undergone a full architectural rewrite. 😓

For instance, v107 switched to HttpClient, removed the IRestClient / IRestRequest / IRestResponse interfaces, made client options immutable post-construction, renamed the Method enum to PascalCase, removed JsonObject, etc.

This PR performs that migration in one go, keeping the public DNSimple client surface unchanged:

  • Rewrote RestClientWrapper to own RestClientOptions and lazily (re)build the underlying RestClient whenever BaseUrl, UserAgent, or the authenticator change — required because v114 makes those immutable after construction.
  • Replaced IRestClient / IRestRequest / IRestResponse with the concrete types throughout HttpService, ServiceBase, RegistrarDelegation, and all mocks/tests. Response.Headers is now IReadOnlyCollection<HeaderParameter>.
  • Migrated Credentials to the new IAuthenticator contract (and the Encoding-aware HttpBasicAuthenticator constructor).
  • Updated RequestBuilder for the v114 RestRequest constructor, and switched serialized-JSON payloads to AddStringBody(..., DataFormat.Json) to avoid double-encoding under the new AddJsonBody(string) overload.
  • Replaced JsonObject (removed in v107) in DomainsPushes with a plain Dictionary<string, object>.
  • Updated the Method enum casing (GETGet, etc.) across all services and tests.
  • Reworked HttpTest.InvalidRequest to exercise HttpService.HandleExceptions directly (exposed as internal with InternalsVisibleTo dnsimple-test), since the previous test mocked interfaces that no longer exist.

Closes #223.

📋 Deployment Pre/Post tasks

N/A

:shipit: Deployment Verification

  • CI passes on this PR (build + 243 existing tests).
  • The next release of the DNSimple NuGet package installs cleanly into a consumer project and authenticates against the sandbox with an OAuth2 token.

@weppos weppos self-assigned this Apr 16, 2026

@san983 san983 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, tested locally and went thru all the diff.

Noticed 2 instances of this warning

'DomainsService.InitiatePush(long, string, string)' is obsolete: 'Use InitiatePushWithIdentifier instead'

But those can be fixed in a new PR

@weppos weppos merged commit e555332 into main Apr 16, 2026
4 checks passed
@weppos weppos deleted the restsharp-114-migration branch April 16, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants