spring-projects / spring-projects/spring-data-rest
Documentation for Validator [DATAREST-750]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Gregor Frey opened DATAREST-750 and commented
Proposal:
Change
For example, to validate instances of the Person class before new ones are saved into the repository, you would declare an instance of a Validator<Person> in your ApplicationContext with the bean name "beforeCreatePersonValidator"
to
For example, to validate instances of the Person class before new ones are saved into the repository, you would declare an instance of a org.springframework.validation.Validator in your ApplicationContext with the bean name "beforeCreatePersonValidator"
Change
In your configuration that subclasses Spring Data REST’s RepositoryRestMvcConfiguration, override the configureValidatingRepositoryEventListener method and call the addValidator method on the ValidatingRepositoryEventListener
to
Configure a DealRepositoryRestConfigurerAdapter bean, override the configureValidatingRepositoryEventListener method and call the addValidator method on the ValidatingRepositoryEventListener
Affects: 2.4.2 (Gosling SR2)
Reference URL: http://docs.spring.io/spring-data/rest/docs/2.4.2.RELEASE/reference/html/#validation
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.