Skip to content
This repository was archived by the owner on Sep 6, 2025. It is now read-only.

Conversation

@nicholi
Copy link
Contributor

@nicholi nicholi commented Nov 4, 2023

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 marked this pull request as draft November 10, 2023 01:36
@nicholi
Copy link
Contributor Author

nicholi commented Nov 10, 2023

Have noted some issues with certain calls. CreateTag for example is responding from API with MethodNotAllowed. Which is odd, as its definitely sending as a POST with correct JSON... still looking into this.

@nicholi
Copy link
Contributor Author

nicholi commented Nov 10, 2023

Resolved now.

@nicholi nicholi marked this pull request as ready for review November 10, 2023 05:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants