I am trying to implement the HAL standard for JSON in a JAX-RS service. My project consists of users containing many projects, containing many nodes, containing a lot of data and pointers to other nodes.
So, when they hit the endpoint, I would like to insert the objects one level deep and the link after that:
- / user has user data and "_embedded" projects, but only these projects contain "_links" for nodes (and self)
- / project / 1234 has "_embedded" nodes, but these _links nodes are for additional data.
Etc.
Jackson JSONFilters look closely, but I do not quite understand this. It is especially relevant that sometimes the property will be displayed in the _embedded collection, and sometimes in the _links using different methods.
Anyone try something like this?
There is HalBuilder, but it looks like it requires manual serialization, which I would like to avoid. Again, Jackson seems to be almost the same code as manual serialization.
source share