-
Notifications
You must be signed in to change notification settings - Fork 472
Jackson2HalModule.HalLinkListSerializer needs default constructor #196
New issue
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
Comments
I don't quite get why you need this in the first place. |
@olivergierke thanks for the quick reply. I am using @JsonSerialize(using = CustomHalLinkListSerializer.class)
public List<Link> getWebLinks() { Where can I get an example on how to use We are using Spring Boot BTW and I have |
This is probably an issue even now! |
This works as designed. |
I am getting this exception:
|
my model is:
|
The original poster's problem and the workaround should not be needed if all you want to do is reuse the existing implementations. |
then I think I am facing a different problem that has the same symptom. I am using HATEOAS 1.0.2.RELEASE. Do you think I should open a new issue for this? Also, I am not using anything custom here |
maybe it will help others too. I faced the same Warning and couldn't find the solution. after debugging a bit in spring dependencies I realized my issue. I missed the produces part in my Get/Put/PostMapping: import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo;
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn;
@RestController
@RequestMapping("/")
public class SubmitController {
@Autowired
private SubmitService submitService;
@PostMapping(value = "/submit", produces = MediaTypes.HAL_JSON_VALUE) // don't leave produces empty or default
public EntityModel<T> submit(@Valid @RequestBody SubmitEntity submitEntity,
SubmitAnswer submitAnswer = submitService.submit(submitEntity);
return EntityModel.of(submitAnswer, linkTo(methodOn(getClass()).submit()).withSelfRel());
} |
I tried to reuse
HalLinkListSerializer
in one of my ResourceSupport objects to render a list of links usingIt worked under one scenario, but on another Jackson would throw an exception saying that Jackson2HalModule$HalLinkListSerializer has no default constructor.
I have a temporary workaround using this
The text was updated successfully, but these errors were encountered: