I followed these two links/tutorials:
a) Spring MVC: How to perform validation?
b) https://g00glen00b.be/validating-the-input-of-your-rest-api-with-spring/
It works fine except for one thing. Eventhough my controller is annotated with @RestController the response I get is HTML, unlike the JSON response shown in the tutorial.
Questions:
- Which component/bean is the "culprit" which builds and returns the HTML response?
- How to make it return a response body instead of a view?
- How to override this component with a custom one?
Best! Pawel