Link to home
Start Free TrialLog in
Avatar of nicedone
nicedone

asked on

error received during json deserialization,help pls

i am trying to deserialize below json response but getting an error while doing so

error i am getting is below;

Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'SPIN.MarketManagement.Common.Models.DTO.MarketResponse' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.

To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection

[[{"Id":"group_a.manual.manual.bacsc1-8ba8-4994-8708-bc2b28b679a7","Version":13,"Name":"4th Shirt Supremacy: Bar/Hen","WebName":"4th Goal Shirt Supremacy: Bar/Hen","Order":110,"IsRestricted":false}]]

Open in new window



that desealization code is not a new function , it is working already with many apis already, but my new function api that i implemented is gettting an error at that function,how can i fix this error
Avatar of ste5an
ste5an
Flag of Germany image

It's hard to guess without the relevant code. But maybe you just have not set the correct deserialization attributes in your DTO.
Avatar of nicedone
nicedone

ASKER

@ste5an, i removed one of the '[' from the beginning and one ']' from the end , then it worked but it is a dirty solution which i would not really want to implement how can i get the response return with one [ ] instead of [[  ]] in the json?
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial