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

OperationCustomizer is not working with Spring Data REST #2062

Closed
golabk opened this issue Feb 6, 2023 · 2 comments
Closed

OperationCustomizer is not working with Spring Data REST #2062

golabk opened this issue Feb 6, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@golabk
Copy link

golabk commented Feb 6, 2023

Describe the Feature

Operations exported by @RepositoryRestResource is not handled by OperationCustomizer. They cannot be customized.

To Reproduce
Steps to reproduce the behavior:

  1. Create the entity
    @Entity public class MyEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; }
  2. Create spring data jpa repository wtih @RepositoryRestResource annotation
    @RepositoryRestResource public interface MyRepository extends JpaRepository<MyEntity, Long> { }
  3. Create operation customizer
    @Bean OperationCustomizer operationCustomizer() { return (operation, handlerMethod) -> { log.info("operation:" + operation.getOperationId()); return operation; }; }
  4. Run the application and see the logs. There is no Spring Data REST operations in logs.
  • What version of spring-boot you are using?
    3.0.2
  • What modules and versions of springdoc-openapi are you using?
    2.0.2

Expected behavior
OperationCustomizer capability apply to all Spring Data REST methods.

Additional context
Methods exported by @RepositoryRestResource cannot be customized, but methods exported by @RepositoryRestController or @BasePathAwareController are handled by OperationCustomizer.

@bnasslahsen bnasslahsen added the enhancement New feature or request label Feb 8, 2023
@bnasslahsen
Copy link
Contributor

@golabk,

This is an enhancement request!
There are no Customizers supported for spring-data-rest

@bnasslahsen
Copy link
Contributor

@golabk,

DataRestRouterOperationCustomizer is now introduced for this purpose.

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

No branches or pull requests

2 participants