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

QuerydslPredicateOperationCustomizer: black and whitelist no longer works because of Spring Data Commons change since SpringBoot 2.3.2 #814

Closed
chrisupb opened this issue Aug 4, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@chrisupb
Copy link
Contributor

chrisupb commented Aug 4, 2020

Because of this breaking change in Spring Data commons https://jira.spring.io/browse/DATACMNS-1744, the following lines in https://github.com/springdoc/springdoc-openapi/blob/master/springdoc-openapi-data-rest/src/main/java/org/springdoc/data/rest/customisers/QuerydslPredicateOperationCustomizer.java
lead to a null pointer exception:

Set<String> blacklist = getFieldValues(bindings, "blackList"); Set<String> whiteList = getFieldValues(bindings, "whiteList");

SpringBoot 2.3.2
Springdoc-openapi 1.4.1

@bnasslahsen
Copy link
Contributor

@chrisupb,

springdoc-openapi 1.4.1, was released and tested against spring-boot 2.3.0;

Next release will support the impacts introduced by 2.3.2 spring-boot release: see this commit for more details 94f9207

@chrisupb
Copy link
Contributor Author

Please reopen. The latest version of springdoc-openapi 1.4.4 improves the situation, however black and whitelists are still not evaluated.

SpringBoot 2.3.2, springdoc-openapi 1.4.4; For this code OpenAPI contains ALL properties of QMyClassEntity.

@QuerydslPredicate(root = QMyClassEntity.class, bindings = MyClassBinder .class) Predicate predicate,

` private static class MyClassBinder implements QuerydslBinderCustomizer {

@Override
public void customize(QuerydslBindings bindings, QMyClassEntity root) {

  // exclude all properties from QMyClassEntity
  bindings.excludeUnlistedProperties(true);

  // define an explicit whitelist for properties to include
  bindings.including(root.quantity);

  // define an explicit blacklist for properties to include
  bindings.excluding(root.orderId);
}

}`

@sscholl
Copy link

sscholl commented Aug 11, 2020

@bnasslahsen yes, blacklist/whitelist not working

@bnasslahsen bnasslahsen reopened this Aug 11, 2020
@bnasslahsen
Copy link
Contributor

bnasslahsen commented Aug 11, 2020

@chrisupb or @sscholl,

Ok. Should be now fixed.
You can validate with the lastest version of the master.

@bnasslahsen bnasslahsen changed the title QuerydslPredicateOperationCustomizer: black and whitelist no longer works because of Spring Data Commons change QuerydslPredicateOperationCustomizer: black and whitelist no longer works because of Spring Data Commons change since SpringBoot 2.3.2 Aug 11, 2020
@bnasslahsen bnasslahsen added the enhancement New feature or request label Jan 10, 2022
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

3 participants