skip to Main Content

Json – Deserialization using jackson mapper annotations in java

I am trying to deserialize the following json using Jackson annotations. Here is my current code: @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceType") @JsonSubTypes({ @JsonSubTypes.Type(value = StripeServiceConfiguration.class, name = "Stripe"), @JsonSubTypes.Type(value = BrainServiceConfiguration.class, name = "Brain"), })…

VIEW QUESTION

Getting error: Newtonsoft.Json.JsonSerializationException: 'Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'myclass'

I am trying to deserialize a javascript kind of JSON "{n "resultSet1": [n {n "AgentID": 13173,n "FirstName": "Drilon",n "SG_ID": 14336,n "LoginName": "UI813926",n "SG_Description": "LKC Bauhotline",n "SG_Name": "Y_BAU__FO",n "EnterpriseName": "LKC_Abdullahu_Drilon",n "LastName": "Abdullahu"n },n {n "AgentID": 14432,n "FirstName": "Pinar",n "SG_ID": 14336,n "LoginName":…

VIEW QUESTION

Asp.net – Deserialize an object that can have string or int from JSON format

How do I deserialize an object from JSON format with valid data using JsonConvert.DeserializeObject(useCaseData)? I tried it with JsonConvert.DeserializeObject<Dictionary<string, string>>(useCaseData) But I get this error : Newtonsoft.Json.JsonSerializationException: 'Error converting value 1 to type 'System.Collections.Generic.Dictionary`2[System.String,System.String]'. Path '', line 1, position 1.…

VIEW QUESTION
Back To Top
Search