You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
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)
The text was updated successfully, but these errors were encountered: