Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort field is ignored when using Custom Controller [DATAREST-1368] #1701

Open
spring-projects-issues opened this issue Apr 24, 2019 · 1 comment
Assignees
Labels
type: bug A general bug

Comments

@spring-projects-issues
Copy link

Anuj Jamwal opened DATAREST-1368 and commented

Root Cause

When creating a custom controller, there is no way to specify the DomainClass. For a nested resource path like GET /posts/1/comments, the DomainClass is resolved as Post. The Sort Translator ignores the sort fields specified in the query params since they dont belong in the Post class.

 

Possible Resolution

The current logic in DomainClassResolver looks at the path and takes the first word as the repository. One possible resolution would be to allow the controller to explicitly specify the domain class. That way the DomainClassResolver can use this information to return the domain class rather than looking at the URL

 

Another method could be have an annotation that can be specified on method itself or have both.

 

 


Affects: 3.1.6 (Lovelace SR6)

@Sonictherocketman
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants