我想使用Order
类架构在Swagger UI中显示两个不同的示例。您能帮我在这里使用什么注释吗?我在Swagger 2.0中使用Spring MVC
型号:
public class Order {
@ApiModelProperty(value = "Order Event", required = true, example = "Pending/Declined/Charged")
private String event;
private String status;
private String reason;
}
示例1:
{
"event": "PENDING",
"status": "Approved"
}
示例2:
{
"event": "DECLINED",
"status": "denied",
"reason": "payment error"
}