spring-projects / spring-projects/spring-hateoas

entitylinks not extends ordered so it cant not sort

Open
#866 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
476
PR merge metrics
No merged PRs in 30d

Description

currently EntityLinks (ControllerEntityLink,RepositoryEntityLinks) not implement ordered interface and no Order annotation.
so when we use the default DelegatingEntityLinks ,it use PluginRegistryFactoryBean to wrap entityLinks list(internal use a OrderAwarePluginRegistry to sort), but cant not sort, and the findOrder return null(Long) and (lowestorder long).

the behavior at 0.23 and 0.25 work not the same. when i use 0.23, the order is RepositoryEntityLink, ControllerEntityLink, jaxControllerLink. but 0.25 the RepositoryEntityLink order the last! so when i use spring data rest, the /api interface show the wrong result.

relative file is LinkBuilderBeanDefinitionRegistrar, RepositoryRestMvcConfiguration(at spring data rest mvc 2.6.11).

I want it can order by myself, or customise it .

Contributor guide

No contributing guide indexed for this repository

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 reading LinkBuilderBeanDefinitionRegistrar and RepositoryRestMvcConfiguration, then trace how DelegatingEntityLinks uses PluginRegistryFactoryBean and OrderAwarePluginRegistry. Compare the EntityLinks ordering behavior between the reported versions 0.23 and 0.25. Done means EntityLinks can be ordered consistently or customized so Spring Data REST exposes the correct API result.

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
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.