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

@JsonIgnoreProperties ignored on superclass #374

Closed
tkalmar opened this issue Jun 19, 2020 · 1 comment · Fixed by #384
Closed

@JsonIgnoreProperties ignored on superclass #374

tkalmar opened this issue Jun 19, 2020 · 1 comment · Fixed by #384
Milestone

Comments

@tkalmar
Copy link

tkalmar commented Jun 19, 2020

We have a quarkus (1.4.2.Final) project with smallrye-openapi in version 1.2.3.

We have an abstract Superclass

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(value = {"field1"})
public abstract class SuperClass {

abstract getField1() {
}
abstract setField1(String value) {
}
}

and some Child classes

public final class ChildClass {

@Override
protected getField1(){
...
}
@Override
protected setField1(String value){
...
}
}

In swagger-ui we see field1 in all subclasses of Superclass. If we put the @JsonIgnoreProperties(value = {"field1"}) on the child classes all is fine and the field is ignored.

Same for @JsonIgnore or @Schema(hidden=true) all work at child class level but are ignored if used on super class.

It is cumbersome to always remember to annotate each new child, so it would be great if this works on super class level

@tkalmar
Copy link
Author

tkalmar commented Jun 19, 2020

cc @famod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants