spring-projects / spring-projects/spring-data-rest
Optional parameters for find method
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
It might be somewhere in the documentation but I couldn't find it.
Say I have a query method
findByXAndYAndZ(@Param("u") String x, @Param("v") String y,@Param("w") String z);
When omitting any of the params the method complains about missing parameters, however I'd like some of those options to be optional. I could write something along the lines of
findByX
findByXAndY
findByXAndYAndZ
However it does not seem to be possible to expose them under the same path/rel.
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.
Research direction
Start by examining how the shown findByXAndYAndZ query method binds request parameters and exposes its path/rel. Compare that behavior with the desired findByX, findByXAndY, and findByXAndYAndZ forms. Done should define whether omitted parameters are supported under one path/rel and include coverage or documentation for the resulting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100