I have the following piece of code and swagger is not showing up the way i expect on swagger ui. I'm using annotations to build the swagger definition. I tried using @API and @JsonIgnore. Both did not work for me.
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import io.swagger.annotations.Api;
@JacksonXmlRootElement(localName = "traction")
@Api(hidden = true)
public class Traction
{
private JsonNode traction;
public JsonNode getTraction()
{
return traction;
}
public void setTraction(final JsonNode traction)
{
this.traction = traction;
}
}
Swagger definition gets displayed as follows -
"tractionParent": {
"traction": {
"array": false,
"null": false,
"float": false,
"containerNode": false,
"missingNode": false,
"nodeType": "ARRAY",
"valueNode": false,
"object": false,
"pojo": false,
"number": false,
"integralNumber": false,
"short": false,
"int": false,
"long": false,
"double": false,
"bigDecimal": false,
"bigInteger": false,
"textual": false,
"boolean": false,
"binary": false,
"floatingPointNumber": false
}
}
I need it to show up as
"tractionParent": {
"traction": {
}
}