Forum Discussion

mar71n's avatar
mar71n
New Member
5 years ago

Specify visibility for field in example based on endpoints

I would like to hide fields in certain endpoints, and show them in others, is that possible? 

 

Let me give an example: 

class User{

   @ApiModelProperty(notes = "Unique ID for MongoDB", example = "oweqihti2q35", hidden = true)

   String id; 

}

 

I want to hide this for some createUser endpoint, simply because I want the mongoDB to generate the ID. 

But if I want to provide an endpoint deleteUserPerID, I would like to have this field not hidden anymore. 

How can I do that? 

No RepliesBe the first to reply