Closed antonicg closed 7 years ago
I think we can handle following data with this library
{
"type": "articles",
"id": "tlgGJKIqxIo",
"attributes": {
"title": {
"value": "This is the full title",
"short": "Title in short"
}
}
}
And the Java code:
public class TitleObject {
String value;
String short;
}
The Article
class like:
@JsonApi(type = "articles")
public class Article {
TitleObject title;
// ...
}
You can use customized adapter for TitleObject
as is described by moshi.
Okay thanks!
Is there any trouble if the attributes object inside a Resource has a title that is an object instead of String? I have this case, also I'm trying to use my own attributes object with no success. Is a limitation of the library?