caspar-chen / swagger-ui-layer

基于swagger的漂亮的接口文档
Apache License 2.0
532 stars 232 forks source link

response 是多层复杂json,而且是调用第三方的,可能随时加字段,怎么解决在ui显示问题 #42

Open huang-xuan opened 5 years ago

huang-xuan commented 5 years ago

{ "code": 0, "data": { "cancel_fee_detail": [], "booking_cancel_fee_detail": [], "drivers": [], "bookings": [], "polling_state": 2, "polling_count": "1", "next": 10 }, "message": "成功" }

image

caspar-chen commented 5 years ago

如果第三方的无法控制显示的描述的话,建议自己定义一个对象,这个对象里面的字段跟第三方的字段保持一致,并写上注释;然后再response指定你的 @ApiOperation(response = YourObj.class)