WTF - The latest version of RestSharp has a major breaking change
-
Version 12.0.3:
public enum Method
{
GET,
POST,
PUT,
DELETE,
HEAD,
OPTIONS,
PATCH,
MERGE,
COPY
}Version 13.0.1:
public enum Method { Get, Post, Put, Delete, Head, Options, Patch, Merge, Copy, Search }
Why would they do that? That breaks code everywhere! :mad:
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesThat bit me too Marc
"Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
-
The indenting in the first example is as broken as the capitalization changes in the second one. X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| &n
-
WTF! I don't even code in RestSharp and I know that is f****ed up.:mad:
Exactly, who the heck put that Search item in there 😁
-
As the new CIO, I would probably lie awake thinking on why this enum had to be shouting in the first place. I tend to do that with some of my code comments as I get older though. ATTENTION: ... (stringing HTML?)
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
Someone probably got a warning/hint in VS that the naming didn't meet standards, and thought to correct it....
-
Version 12.0.3:
public enum Method
{
GET,
POST,
PUT,
DELETE,
HEAD,
OPTIONS,
PATCH,
MERGE,
COPY
}Version 13.0.1:
public enum Method { Get, Post, Put, Delete, Head, Options, Patch, Merge, Copy, Search }
Why would they do that? That breaks code everywhere! :mad:
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and Services -
If adding an Enum entry (Search) breaks your code, you have serious problems. I'd be more concerned about the shift from all CAPS to Proper case - too many languages are case sensitive.
-
Version 12.0.3:
public enum Method
{
GET,
POST,
PUT,
DELETE,
HEAD,
OPTIONS,
PATCH,
MERGE,
COPY
}Version 13.0.1:
public enum Method { Get, Post, Put, Delete, Head, Options, Patch, Merge, Copy, Search }
Why would they do that? That breaks code everywhere! :mad:
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesIt's a major version bump, so if they were looking to change their casing, this is the _exactly_ right time to do it. You should be able to fix up without too much trouble - either automated find-and-replace (followed by a build to test) or just human find-and-replace shouldn't take that long unless you literally have thousands of REST requests in your project. The newer naming is consistent with System.Net.Http.HttpMethod values (and overall accepted C# naming conventions)
------------------------------------------------ If you say that getting the money is the most important thing You will spend your life completely wasting your time You will be doing things you don't like doing In order to go on living That is, to go on doing things you don't like doing Which is stupid. - Alan Watts https://www.youtube.com/watch?v=-gXTZM\_uPMY
-
ALLCAPS, I think is the standard in RestAPIs, when using Postman to test my own code, it's all CAPS there.
For the values, sure, but that's not the standard when coding enum values. FWIW, I think this is a good change, putting RestSharp in consistent line with other libaries (including System.Net) and making the change in a major version bump is _exactly_ the right place to do it.
------------------------------------------------ If you say that getting the money is the most important thing You will spend your life completely wasting your time You will be doing things you don't like doing In order to go on living That is, to go on doing things you don't like doing Which is stupid. - Alan Watts https://www.youtube.com/watch?v=-gXTZM\_uPMY
-
Version 12.0.3:
public enum Method
{
GET,
POST,
PUT,
DELETE,
HEAD,
OPTIONS,
PATCH,
MERGE,
COPY
}Version 13.0.1:
public enum Method { Get, Post, Put, Delete, Head, Options, Patch, Merge, Copy, Search }
Why would they do that? That breaks code everywhere! :mad:
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and Services -
Version 12.0.3:
public enum Method
{
GET,
POST,
PUT,
DELETE,
HEAD,
OPTIONS,
PATCH,
MERGE,
COPY
}Version 13.0.1:
public enum Method { Get, Post, Put, Delete, Head, Options, Patch, Merge, Copy, Search }
Why would they do that? That breaks code everywhere! :mad:
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and Services -
Version 12.0.3:
public enum Method
{
GET,
POST,
PUT,
DELETE,
HEAD,
OPTIONS,
PATCH,
MERGE,
COPY
}Version 13.0.1:
public enum Method { Get, Post, Put, Delete, Head, Options, Patch, Merge, Copy, Search }
Why would they do that? That breaks code everywhere! :mad:
Latest Articles:
ASP.NET Core Web API: Plugin Controllers and ServicesThat bit me too Marc
"Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP