spring-projects / spring-projects/spring-data-rest
Query methods should ne be exposed if they don't use the @Param annotation for parameters [DATAREST-29]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Oliver Drotbohm opened DATAREST-29 and commented
As the parameter names of the query methods cannot be derived from the interface (due to a limitation of the JVM) they effectively need to be annotated using @Param to be able to be invoked by a client. Currently the methods still get exposed but cannot be invoked properly as parameter binding will always fail.
I suggest to not expose the methods not annotated with @Param and trigger a WARN log unless they are explicitly excluded from being exported through @RestResource(exported = false)
Affects: 1.0.0.RC2
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 tracing how repository query methods are exposed and how @Param metadata is checked. Verify the behavior for unannotated parameters, explicit @RestResource(exported = false), and WARN logging; done means invalid methods are not exposed while properly annotated methods remain invocable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100