This is a repeat of issue #730 because, to my understanding, it wasn't implemented. This would be used when extending third party classes.
@bthule already showed an example:
Here is sample model for super+inherited classes:
// A super class provided by third-party
public class Animal {
String uselessAnnoyingProperty;
}
// A sub class whose api-model should not have uselessAnnoyingProperty
public class Dog extends Animal {
int numberOfLegs;
}
swagger-ui would show:
{
"numberOfLegs": 0,
"uselessAnnoyingProperty": "",
}
The solution he suggested is:
@ApiModel(hideProperties = {"uselessAnnoyingProperty", ...})
Feels like an edge case. If you can add a PR with a generalized solution, would be happy to add it.
@aciganj I had the same exact issue using Ebean and the swagger annotations were adding _ebean_intercept to my documentation. I solved this by adding a getter to my model
@ApiModelProperty(hidden = true)
public boolean get_ebean_intercept() {
return false;
}
You can also use @JsonIgnore