Skip to content

QuerydslBinderCustomizer alias being removed when using excludeUnlistedProperties #1075

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
rafaelndev opened this issue Feb 22, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@rafaelndev
Copy link

rafaelndev commented Feb 22, 2021

Describe the bug

When we define a alias with QuerydslBinderCustomizer and set excludeUnlistedProperties = true, this alias is removed from the swagger definition.

To Reproduce

  • Spring Boot 2.4.3
  • Springdocs 1.5.4

For example, if we have a User Entity, with email and firstName atributes, and we want to make a alias firstName -> name:

    @Override
    default void customize(QuerydslBindings bindings, QUser user) {
        bindings.excludeUnlistedProperties(true);
        bindings.including(user.email);
        bindings.bind(user.firstName).as("name").withDefaultBinding();
    }

The alias "name" works and the filter for firstName is applied if passed by parameter.
Example:
http://localhost:8080/?name=George
But it doesn't show on swagger, only the email attribute is visible.

I made a little example to simulate the problem:
https://github.com/rafaelndev/querydsl-springdoc-example

Expected behavior

When a alias is defined it should be visible in swagger even if excludeUnlistedProperties is true, as it works in request.

This was referenced Mar 16, 2021
@bnasslahsen bnasslahsen added the bug Something isn't working label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants