I have a Student class and I need id
, name
, email
, dob
, age
parameters. These parameters are shown on swagger as below.
I do not want id appear on the swagger documentation. How can I do that?
I have tried
I want to see only below parameters on swagger
{
"name": "string",
"email": "string",
"dob": "2022-12-19",
"age": 0
}
Can anyone help me about that, please?
For me, ApiModelProperty and ApiParam didn't exist. I found the solution on documentation . The solution is as below;
public class Student {
@Schema(accessMode = Schema.AccessMode.READ_ONLY)
private Long id;
}
Also thanks to @Waled Ahmad
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.