I used swagger in my apache cxf project , used @Api and @ApiOperations and @ApiParam annotations and generated a api doc for the rest services.
But I want to exclude
First of all, you should upgrade to the latest swagger-core version, currently 1.3.12 (you're using a really old one).
You have 3 ways to hide a property:
@XmlTransient
.@JsonIgnore
.Keep in mind you may need to set these on your getters/setters rather than on the property itself. Play with the definitions to see what works for you.
With regards to the issue with the User model, the problem is that you do not reference it from the @ApiOperation
(you also don't need the httpMethod property). Try changing it as follows:
@ApiOperation(value = "xxx", notes = "user details", response = User.class)
You can exclude fields like that :
@ApiModelProperty(position = 1, required = true, hidden=true, notes = "used to display user name")