我想在swager的datatype属性中使用generic,结果是swagger页面还可以显示json参数和json响应的示例
我已经找到了一些关于这个问题的答案,可以像这样使用generictype«数组«字节»» 这是我的密码
@ApiOperation(value = "", notes = "insert", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
@ApiImplicitParams({
@ApiImplicitParam(name = "entity", value = "insert", required = true, dataType = "«T»", paramType = "body")
})
@PostMapping(value = "",params = "entity")
@ResponseStatus(HttpStatus.CREATED)
public T insert(@Valid @Validated @RequestBody T entity) {
return service.insert(entity);
}
但它并没有在招摇过市,并显示空的例子
暂无答案!
目前还没有任何答案,快来回答吧!