Skip to content

[springdoc-openapi-data-rest] @RestResource(exported = false) does not work for custom existsByXyz methods #1523

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

Closed
uqix opened this issue Feb 24, 2022 · 1 comment
Labels
invalid This doesn't seem right

Comments

@uqix
Copy link

uqix commented Feb 24, 2022

Describe the bug

@RestResource(exported = false) does not work for custom existsByXyz methods

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using? 2.5.4
  • What modules and versions of springdoc-openapi are you using? springdoc-openapi-data-rest
  • Provide with a sample code (HelloController) or Test that reproduces the problem
package app.pricequery;

import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.data.rest.core.annotation.RestResource;

@RepositoryRestResource
public interface DisabledPriceQueryRepository extends CrudRepository<DisabledPriceQuery, Long> {

    // case 1 error: org.springframework.data.mapping.MappingException: Couldn't find PersistentEntity for type boolean!
    @RestResource(exported = false)
    boolean existsByUserNicknameAndMatchKeyword(String userNickname, String matchKeyword);

    // case 2 works
    @RestResource(exported = false)
    DisabledPriceQuery findByUserNickname(String userNickname);

    // case 3 works
    @RestResource(exported = false)
    @Override
    void deleteById(Long id);
}

Expected behavior

  • existsByUserNicknameAndMatchKeyword method should not be exposed.
@bnasslahsen
Copy link
Collaborator

@uqix,

Not reproducible using v1.6.8. See the updated test case.
If you believe you are facing an issue, make sure you provide a Minimal, Reproducible Example - with HelloController that reproduces the problem.

@bnasslahsen bnasslahsen added the invalid This doesn't seem right label Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants