I have the same issue currently. My hottest of hotfixes overrode the default serialization of the Link object with this serializer.
public class LinkDecodingSerializer extends JsonSerializer<Link> {
@Override
public void serialize(Link value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
/*
* {
* "relationName": {
* "href": "http://localhost:69420/@cool@/api"
* }
* }
*/
gen.writeStartObject();
gen.writeStringField("href", UriUtils.decode(value.getHref(), StandardCharsets.UTF_8));
gen.writeEndObject();
}
}
Unfortunately I then discovered that that there is an internal HalLink wrapper of the Link class which made the end result look like
"link": {
"relationName": {
"href": "http://localhost:69420/@cool@/api"
}
}
This was also a problem so I had to add a HalLink serializer implementation which worked with reflection because HalLink is hidden internal class. I am currently looking for a more intelligent solution