I want to hide the "id" item in the model, how to do this in java?
This is all you need to add to hide the field in the Swagger ui: @ApiModelProperty(hidden = true) private List<Reservation> reservations; That would hide the reservation list from showing.
How to do it? add this property in your Swagger UI Options defaultModelsExpandDepth: -1 for hide schema section and for more reference refer this swagger.io/docs/open-source-tools/swagger-ui/usage/… Can you please add your swagger ui configuration settings in your question.
Open the API page in SwaggerHub. Click to make the version private or to make it public.
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
@ApiModelProperty(accessMode = ApiModelProperty.AccessMode.READ_ONLY)
private String id;
Also see: https://github.com/springfox/springfox/issues/2816
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With