I am bulding a REST API in Spring. So until now I have only reading services (GET). For this I used Spring HATEOAS to add links that referring to child elements.
Now I want to add some writing REST-Services. Usually DTOs are used in REST-Services and those are then mapped to the domain model.
So my question is: Can we just use resources from Spring HATEOAS as in the example below and do without DTOs? Or are resources intended for something else and I still need DTOs?
@PostMapping
public ResponseEntity<String> saveProduct(@RequestBody ProductResource product) {
...
}