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]

Open
#412 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.