spring-projects / spring-projects/spring-hateoas

Reserved keyword (?) in rel doesn't add curie

Open
#625 1 comment 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

I have an IndexController that links to my public endpoints:

@GetMapping("/") public HttpEntity<ResourceSupport> exposeIndex() { ResourceSupport indexResource = new ResourceSupport(); indexResource.add(ControllerLinkBuilder.linkTo(AController.class).withRel("a")); indexResource.add(ControllerLinkBuilder.linkTo(BController.class).withRel("b")); indexResource.add(ControllerLinkBuilder.linkTo(ProfileController.class).withRel("profile")); return ok().body(indexResource); }

In my SpringBootApplication, I have this CurieProvider:
@Bean public CurieProvider curieProvider() { return new DefaultCurieProvider("ns", new UriTemplate("/api-docs/api-guide.html#resources-{rel}")); }

In the IndexController, the link to the ProfileController has no currie. The other links are correct.

When I change it's rel to "prof", all links are correct.

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 with the IndexController example and the CurieProvider configuration, then trace how DefaultCurieProvider handles the rel value "profile" versus "prof". Reproduce the missing CURIE and identify the relevant Spring HATEOAS link or CURIE tests; done means the "profile" relation receives the expected CURIE without breaking the other relations.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.