Comments (3)
好的,感谢反馈
from knife4j.
第三个,paramsType="query"的显示这个应该是swagger给出的application/json
ui这边应该没有处理的
from knife4j.
https的应该是构建curl的功能吧?文档中只有该处我是写死的,发送时没有使用绝对地址
关于第二点,dataTypeClass = BigDecimal.class ,生成文档变成了 string;我测试了下:
代码:
@ApiOperation(value = "BigDecimal类型->String类型",position = 2)
@PostMapping("/dataBigDeciaml1")
@ApiImplicitParam(name = "bigDecimal",dataTypeClass = BigDecimal.class,value = "工资",required = true)
public Rest<BigDecimal> dataBigDeciaml1(BigDecimal bigDecimal){
Rest<BigDecimal> r=new Rest<>();
r.setData(bigDecimal);
return r;
}
最终查看swagger生成的json文件结构如下:
{
"post": {
"tags": [
"1.8.5版本-20180925"
],
"summary": "BigDecimal类型->String类型",
"operationId": "dataBigDeciaml1UsingPOST",
"consumes": [
"application/json"
],
"produces": [
"*/*"
],
"parameters": [
{
"name": "bigDecimal",
"in": "query",
"description": "工资",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Rest«bigdecimal»"
}
},
"201": {
"description": "Created"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
},
"security": [
{
"BearerToken": [
"global"
]
},
{
"BearerToken1": [
"global"
]
}
],
"deprecated": false
}
}
从结构中,swagger给出的BigDecimal类型是string,还有consumes ["application/json"],所以UI显示的也是如此
如果用下面Java方法类测试:
@ApiOperation(value = "BigDecimal类型解析为String类型",position = 1)
@GetMapping("/dataBigDeciaml")
public Rest<Model1851> dataBigDeciaml(@RequestBody Model1851 model1851){
Rest<Model1851> r=new Rest<>();
r.setData(model1851);
return r;
}
Model1851 类包含BigDecimal类型
public class Model1851 {
private BigDecimal total;
private String name;
//getter and setter....
}
生成的BigDecimal是Number类型.
Swagger的json结构如下:
{
"get": {
"tags": [
"1.8.5版本-20180925"
],
"summary": "BigDecimal类型解析为String类型",
"operationId": "dataBigDeciamlUsingGET",
"produces": [
"*/*"
],
"parameters": [
{
"in": "body",
"name": "model1851",
"description": "model1851",
"required": true,
"schema": {
"$ref": "#/definitions/Model1851"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Rest«Model1851»"
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
},
"security": [
{
"BearerToken": [
"global"
]
},
{
"BearerToken1": [
"global"
]
}
],
"deprecated": false
}
}
from knife4j.
Related Issues (20)
- knife4j-aggregation-spring-boot-starter不支持springboot3
- com.github.xiaoymin.knife4j.extend.filter.basic.ServletSecurityBasicAuthFilter.doFilter(ServletSecurityBasicAuthFilter.java:56) 空指针 HOT 2
- Knife4j文档请求异常 HOT 1
- [v4.5.0]Get/Delete参数是否可以默认勾选,如图所示 HOT 14
- 文档如何根据@JsonView 注解 显示必要字段 HOT 1
- doc.html响应示例数据格式混乱 HOT 5
- 通过swagger.v3的注解@ApiResponse定义的Response Content无法展示 HOT 1
- @ApiOperationSupport(ignoreParameters = {"id"})不生效 版本信息如下
- knife4j springboot2.0 + openapi3 部署到服务器上 报错部分资源访问异常 HOT 1
- SpringBoot3 报 javax.servlet.Filter java.lang.ClassNotFoundException错误 HOT 2
- knife4j文档请求异常 HOT 2
- Spring Boot3 版本,接口返回子字段含泛型展示错误 HOT 13
- Kotlin DataClass 解析出重复字段 HOT 3
- knife4j 无法展示多个对象属性
- @Tag name属性 和 @Operation summary属性 字符'/' 在页面中展示时被替换为 '-' HOT 2
- 响应参数及响应实例中不能正确展示 $ref 的值 HOT 2
- yml配置不支持showTagStatus参数,文档前端实现包含这个参数 HOT 3
- knife4j-gateway-spring-boot-starter cannot support fully expanded arguments for predicates HOT 1
- 多层级泛型不显示字段注释 使用spring boot3和spring doc HOT 11
- 生成的md文档,请求参数类型无法正确配置
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knife4j.