We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My JSON response has 3 nested relationships in it which looks like this:
relationships
lib can parse the blue and red layers but when it comes to the green layer. It cant be parsed and only return null
blue
red
green
My data class:
@JsonApi(type = "navigation-items") data class JsonNavigationItem( @field:Json(name = "id_category") val categoryId: Int? = null, val name: String? = null, @field:Json(name = "text_color") val textColor: String? = null, val media: JsonMedia? = null, @field:Json(name = "navigation-items") val navigationItems: HasMany<JsonNavigationItem>? = null, ) : Resource()
Here is my sample json:
{ "data": [{ "type": "navigation-items", "id": "3169", "attributes": { "id_category": 61, "name": "Accessories", "link_rewrite": "accessories" }, "relationships": { "navigation-items": { "data": [{ "type": "navigation-items", "id": "73", "relationships": { "navigation-items": { "data": [{ "type": "navigation-items", "id": "79" }, { "type": "navigation-items", "id": "80" }, { "type": "navigation-items", "id": "124" }, { "type": "navigation-items", "id": "101" }, { "type": "navigation-items", "id": "396" }, { "type": "navigation-items", "id": "397" }, { "type": "navigation-items", "id": "398" }, { "type": "navigation-items", "id": "399" }, { "type": "navigation-items", "id": "400" }, { "type": "navigation-items", "id": "109" }, { "type": "navigation-items", "id": "401" }, { "type": "navigation-items", "id": "2293" }, { "type": "navigation-items", "id": "402" }, { "type": "navigation-items", "id": "403" }, { "type": "navigation-items", "id": "247" }, { "type": "navigation-items", "id": "404" } ] } } }, { "type": "navigation-items", "id": "74" }, { "type": "navigation-items", "id": "77" }, { "type": "navigation-items", "id": "75" } ] } } }, { "type": "navigation-items", "id": "3225", "attributes": { "id_category": 12, "name": "Shirts - Short Sleeve", "link_rewrite": "shirts-short-sleeve" }, "relationships": {} } ] }
The text was updated successfully, but these errors were encountered:
A resource linkage object (the data field in values of relationships field) can be a single or an array of resource identifier object. AFAIK, the use of relationships in a resource identifier object is not supported by the specification.
data
Sorry, something went wrong.
No branches or pull requests
My JSON response has 3 nested
relationships
in it which looks like this:lib can parse the
blue
andred
layers but when it comes to thegreen
layer. It cant be parsed and only return nullMy data class:
Here is my sample json:
The text was updated successfully, but these errors were encountered: