spring-projects / spring-projects/spring-hateoas

Backwards Compatibility Broken in Affordances between 1.3.5 to 1.4.x.

Open
#1,825 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

In semantic versioning, there should be zero breaking changes without bumping the major version.

org.springframework.hateoas.mediatype.Affordances

Between 1.3.5 and 1.4.x the return type of afford(org.springframework.http.HttpMethod) was changed from:

org.springframework.hateoas.mediatype.Affordances.AffordanceBuilder

to:

org.springframework.hateoas.mediatype.ConfigurableAffordance

This breaks the following code:

Affordances
    .of(linkTo(method, params).withRel(relation).withAffordances(new ArrayList<>()))
    .afford(httpMethod).withName(relation.value())
    .toLink();

When the code above is compiled with 1.4.1 on the class path, then used in an application using 1.3.5, this should not break anything as the same method exists in 1.3.5 and there was no bump of the major version. But, as the return type was changed, the code crashes with method not found.

For referenced, here is a complete list of breaking changes that happened with 1.4.x:

https://diff.revapi.org/?groupId=org.springframework.hateoas&artifactId=spring-hateoas&old=1.3.5&new=1.4.1

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 Affordances.afford(HttpMethod) and compare its 1.3.5 and 1.4.1 API signatures using the linked Revapi diff. Reproduce the provided compiled-application scenario, then verify that the public API remains binary-compatible across those versions.

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.