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

Support @JsonIgnore for @ParameterObject #1375

Closed
asiaon123 opened this issue Dec 10, 2021 · 1 comment
Closed

Support @JsonIgnore for @ParameterObject #1375

asiaon123 opened this issue Dec 10, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@asiaon123
Copy link

I'm using @ParameterObject for query string object, and i want to ignore some properties with @JsonIgnore, but i still listed in the swagger page.

Here is an example:

@GetMapping()
public Resp xxx(@ParameterObject SomeRequstObj request) {

}

public class SomeRequestObj {

    ....

    @JsonIgnore
    private Integer someProperies;

}
@bnasslahsen
Copy link
Contributor

bnasslahsen commented Dec 11, 2021

You can use @Hidden or @Parameter(hidden = true) as alternatives.
Or use:

static {
		SpringDocUtils.getConfig().addAnnotationsToIgnore(JsonIgnore.class);
	}

This will be set as default in the future release.

@bnasslahsen bnasslahsen changed the title @JsonIgnore is not worked for @ParameterObject Support @JsonIgnore for @ParameterObject Dec 11, 2021
@bnasslahsen bnasslahsen added the enhancement New feature or request label Jan 9, 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

2 participants