Here is the full example:
public class PaginatedUserData extends UserDataAvro {
@JsonValue
public String serialize() throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
HashMap<String, String> map = new HashMap<>();
map.put("test", "5");
return mapper.writeValueAsString(map);
}
}
Returns:
Could not write JSON: Not an array