Skip to content

Migrate RepositoryRestConfigurerAdapter to RepositoryRestConfigurer #745

@FieteO

Description

@FieteO

What problem are you trying to solve?

As part of the spring-boot (2.4) update, spring-data-rest-webmvc is updated to 3.4.X. With this release, the deprecated import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter is removed and import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer should be implemented instead.

Before

import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;

@Configuration
public class FooRepositoryConfiguration extends RepositoryRestConfigurerAdapter {

    @Override
    public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {}
}

After

import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer;

@Configuration
public class CatalogDbRepositoryConfiguration implements RepositoryRestConfigurer {

    @Override
    public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {}
}

Are you interested in contributing this feature to OpenRewrite?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Recipes Wanted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions