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
CamelCase serialization doesn't work on System.Object after upgrading to: 110.2.0 #2150
Comments
I don't see any serialisation and deserialisation being linked in one execution path. The sample code is deserialising something, and I can't see where the serialisation issue occurs. As your deserialisation result isn't typed, you are basically parsing JSON, and it works as expected. The server returns pascal case, and that's what you get. |
@alexeyzimarev yes exactly I agree. But I think it might be the way it's deserialized that has been changed, when you returning: 'Data'. It looks like it was some kind of KeyValue before (In your previous versions). I've made a work around, that works.
But that's not the proper way of wanna do it. So I was wondering if you have any extensions or anything, so I can get the same data as before? |
Well, yes, before v107 the default serialiser was a fork of SimpleJson, and it created all sort of problems. It's been moved to |
Oh okay! Cool :) That makes sense. So do you have any extensions or something build in or, should I do something else? |
Hi,
I've newly upgraded to version: 110.2.0.
After the upgrade, it will not serialize the data as camelCase, when using:
RestResponse response = await _restClient.ExecuteGetAsync (new RestRequest("/api/users")
.AddHeader("Authorization", string.Format("Bearer {0}", token)));
object result = response.Data;
The object is still PascalCase.
I've tried to override the existing configuration by using the 'UseNewtonsoftJson' without any progress.
RestClient client = new RestClient(url, configureSerialization: s => s.UseNewtonsoftJson());
In addtion: I've also tried:
string json = JsonConvert.SerializeObject(response.Data, new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
Formatting = Formatting.Indented
});
Secondly i've also tried to use the 'UseSystemTextJson'. Here is the response:
{
"valueKind": 2
}
Can you please help me how to fix it? Are there anyway I can configure it as it was in release: 106.15?
The text was updated successfully, but these errors were encountered: