Links are ignored during deserialization
See original GitHub issuethe default simplePropertyMappers
does not work with pagination when body
contains link
example…
{
"meta": {
"totalPages": 13
},
"data": [
{
"type": "articles",
"id": "3",
"attributes": {
"title": "JSON:API paints my bikeshed!",
"body": "The shortest article. Ever.",
"created": "2015-05-22T14:56:29.000Z",
"updated": "2015-05-22T14:56:28.000Z"
}
}
],
"links": {
"self": "http://example.com/articles?page[number]=3&page[size]=1",
"first": "http://example.com/articles?page[number]=1&page[size]=1",
"prev": "http://example.com/articles?page[number]=2&page[size]=1",
"next": "http://example.com/articles?page[number]=4&page[size]=1",
"last": "http://example.com/articles?page[number]=13&page[size]=1"
}
}
when deserialized, will be
[ { type: 'articles',
id: '3',
title: 'JSON:API paints my bikeshed!',
body: 'The shortest article. Ever.',
created: '2015-05-22T14:56:29.000Z',
updated: '2015-05-22T14:56:28.000Z' } ]
I see that setLinks
exists on the simplePropertyMapper
here
but it seems that only links
inside data
will be checked, but not the body.links
( which is where links
will exist if it’s for pagination )
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Ignoring property when deserializing - java - Stack Overflow
My problem is that I want to serialize the money property but ignore while deserializing it i.e., dont accept any values from the...
Read more >Ignore property during deserialization but retain in ... - GitHub
What I'm seeing is @JsonIgnoreProperties({"zip"}) seems to cause property zip to not be required during deserialization (desired), but also ...
Read more >Deserialized JSON with Invalid Ids are ignored silently
Deserialized JSON with Invalid Ids are ignored silently ... a question: why are your clients randomly returning non-Id values in Id fields?
Read more >XmlAttributes.XmlIgnore Property (System.Xml.Serialization)
Gets or sets a value that specifies whether or not the XmlSerializer serializes a public field or public read/write property.
Read more >Gson User Guide - Google Sites
Fields corresponding to the outer classes in inner classes, anonymous classes, and local classes are ignored and not included in serialization or ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@konovalov-nk I use “stuff” to show that it is not “data” from json, in the code they are found nearby
Jsona is a tool to simplify the work with standardized data. Everything inside the meta is not standardized and jsona cannot take into account all the special cases. Thus, everything that is not standardized will look a bit hacky, I think this is normal.
But if you see a way to make jsona better, then welcome, we can consider your PRs 😃