autorest icon indicating copy to clipboard operation
autorest copied to clipboard

SafeJsonConvert not Deserializing entire object

Open bl1nkr opened this issue 10 years ago • 2 comments

On one of my methods I get the entire payload back from the server

_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);

I can see the entire json string. But after

_result.Body = SafeJsonConvert.DeserializeObject<IList>(_responseContent, this.Client.DeserializationSettings);

I get back the list but only one property has data and the are null. Any advice?

I used the autorest.exe and i am running Microsoft.Rest.ClientRuntime 2.3.1 and JSON.NET 9.0.1

thanks!

bl1nkr avatar Jul 05 '16 18:07 bl1nkr

There is nothing special about SafeJsonConvert except that it doesn't inherit global JsonSerializerSettings the way that JsonConvert does. Can you repro this issue with just JsonConvert? What about with older versions of JSON.NET?

bitsforthought avatar Jul 06 '16 19:07 bitsforthought

I had an error in my swagger.json config file. Sorry for blaming the serialier =)

bl1nkr avatar Jul 06 '16 23:07 bl1nkr