JsonApiNet icon indicating copy to clipboard operation
JsonApiNet copied to clipboard

how to map complex types in Attribute

Open mabubakarriaz opened this issue 5 years ago • 0 comments

how to map "name" complex type in attributes with my own class

class

`public class SubscriptionType { public string Id { get; set; }

    public string BusinessModelType { get; set; }

    //[JsonApiRelationship("name")] // [JsonApiAttribute("name")] //not working
    public Name Name;   
}`

public class Name { public string En { get; set; } public string Ur { get; set; } }

json { "data": [ { "attributes": { "business-model-type": "prepaid", "name": { "en": "Start prepaid", "ur": "Start Prepaid" } }, "id": "1", "links": { "self": "/api/v1/subscription-types/1" }, "relationships": { "billing-rate-plans": { "links": { "related": "/api/v1/subscription-types/1/billing-rate-plans" } } }, "type": "subscription-types" } ] }

mabubakarriaz avatar Jan 01 '21 09:01 mabubakarriaz