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

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

Open
EarthCitizen opened this issue Aug 23, 2022 · 0 comments
Open

Comments

@EarthCitizen
Copy link

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

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

No branches or pull requests

1 participant