Skip to content

Upgrade RestSharp dependency#5

Merged
nicholi merged 4 commits intomainfrom
feature/update_dependencies
May 9, 2025
Merged

Upgrade RestSharp dependency#5
nicholi merged 4 commits intomainfrom
feature/update_dependencies

Conversation

@nicholi
Copy link

@nicholi nicholi commented May 9, 2025

RestSharp made quite a few breaking changes to their library (unsure at what version exactly). Running into some dependency problems with other libraries wanting more recent versions of RestSharp. So these are the changes necessary to use most recent releases.

You'll see the majority of changes are simple method/verb types, and parameter type changes.

The real "significant" changes are in Http.Connection and Extensions.RestSharpExtensions, where JSON (de)serialization is occurring. RestSharp was actually using its own hybrid JSON (de)serializer. It was not using Newtonsoft internally (what I originally thought was happening, but unfortunately not). With their updates they abstracted out all serialization completely and deprecated their hybrid serialization in favor of dependencies to handle that. So they have components to choose between using Newtonsoft or System.Text.Json now.

We chose to use Newtonsoft as simplest to make a mostly 1:1 conversion. As Newtonsoft's serializer is quite forgiving, compared to System.Text.Json. Switching to .NET's System.Text.Json would likely be preferable in long run, but would require significantly more testing and checks to assure all is ok. Also this library was already partially using Newtonsoft as well (yet to make the System.Text.Json plunge).

So the major changes controlling (de)serialization were in those classes (Http.Connection and Extensions.RestSharpExtensions). Attempting to keep the current design/flow as much as possible.

We are primarily only using the client for Droplets, so primarily have only tested against those endpoints. Assuming all others should be ok as well. All Unit Tests still pass.

@nicholi nicholi merged commit 21b3c9c into main May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants