Skip to content

OperationCustomizer is not working with Spring Data REST #2062

Closed
@golabk

Description

@golabk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions