openrewrite / openrewrite/rewrite-spring

Migrate HATEOS to v1.0 (Spring boot >= 2.2.0)

Open
#405 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

recipe
Dominant language
Java
Stars
403
Forks
149
Avg merge
2h 33m
Merged PRs (30d)
10

Description

What problem are you trying to solve?

Refactor old SpringBoot HATEOS code so it compiles.

What precondition(s) should be checked before applying this recipe?

SpringBoot version < 2.2.0

Describe the situation before applying the recipe

Code uses one of ResourceSupport/Resource/Resources/PagedResources classes.

Describe the situation after applying the recipe

Old classes have been mapped to new ones.

See https://docs.spring.io/spring-hateoas/docs/current/reference/html/#migrate-to-1.0.changes.representation-models.

Have you considered any alternatives or workarounds?

No.

Any additional context

Spring team provided a migration script.

https://github.com/spring-projects/spring-hateoas/blob/main/etc/migrate-to-1.0.sh

Are you interested in contributing this recipe to OpenRewrite?

Sure.

Contributor guide

Open the contributing guide

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 Spring HATEOAS 1.0 migration guide and the referenced migrate-to-1.0.sh script. Identify uses of ResourceSupport, Resource, Resources, and PagedResources, then verify that the recipe maps them to the new representation-model classes and that the transformed code compiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.