-
Notifications
You must be signed in to change notification settings - Fork 296
Add HTTP style to the Request-example #588
base: master
Are you sure you want to change the base?
Conversation
|
麻烦说明下这个pr的目的是什么,什么场景需要。也提供下这个修改前后的一个文档效果对比图 |
|
提供一种 HTTP形式 Request-example ,和浏览器控制台调试网络请求格式一致,还有可以通过VSCode插件Rest-client调试接口 post form-data upload file get form-data |
|
curl下的http 样例可以在restclient中直接使用吗? |
|
get form-data 可以用,其他的用不了 |
| List<ApiParam> queryParams = apiMethodDoc.getQueryParams(); | ||
| List<ApiParam> requestParams = apiMethodDoc.getRequestParams(); | ||
| StringBuilder title = new StringBuilder().append("### ").append(apiMethodDoc.getDesc()).append("\n"); | ||
| StringBuilder request = new StringBuilder().append(methodType).append(" ").append(apiMethodDoc.getUrl()).append(isGet ? " " : " HTTP/1.1").append("\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http/1.1这个硬编码是不是不太好,也存其它版本
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是参考Rest-client标准,有无对代码无影响。
| /** | ||
| * http flag | ||
| */ | ||
| private boolean http; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个定义是不是语义不够精细。http代表配置http协议呢还是http样例呢,可以换个更详细的单词
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
能否给建议个合适的单词?
|
|
||
| default ApiRequestExample buildReqJson(DocJavaMethod javaMethod, ApiMethodDoc apiMethodDoc, String methodType, | ||
| ProjectDocConfigBuilder configBuilder, FrameworkAnnotations frameworkAnnotations) { | ||
| default String buildHttpJson(DocJavaMethod docJavaMethod, ApiMethodDoc apiMethodDoc, String methodType, ProjectDocConfigBuilder projectBuilder, FrameworkAnnotations frameworkAnnotations) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下面这新增的内容是不是在html的文档格式下不起作用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
html的文档格式下指什么功能及作用
|
有用 |
# Conflicts: # pom.xml # src/test/java/com/ly/doc/ApiDocTest.java
添加HTTP样式Request-example