skip to Main Content

json string is not converting to model

I have json response as below. {"StatusCode":1,"Data":{"AndroidVersion":"1","IOSVersion":"1"},"Pager":null,"Error":null} Now I want to convert to model where I have string extension as below. func toJSON() -> Any? { guard let data = self.data(using: .utf8, allowLossyConversion: false) else { return nil } return…

VIEW QUESTION

Json – Jackson using deduction-base deserialization when fields are missing

I am using Jackson to de-serialize this class import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = DatiSocieta.class, name = "datiSocieta"), @JsonSubTypes.Type(value = DatiPersonaFisica.class, name = "datiPersonaFisica") , @JsonSubTypes.Type(value = DatiDittaIndividuale.class, name = "datiDittaIndividuale") } ) public interface Dati…

VIEW QUESTION
Back To Top
Search