Smart-doc is a java restful api document generation tool. Smart-doc is based on interface source code analysis to generate interface documentation, completely zero-injection.
Describe the bug (Bug描述,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)
When a request contains both a @RequestBody parameter and an unannotated form parameter (e.g., BasePager), the generated API documentation incorrectly places the unannotated parameter (BasePager) in the request body. However, it should be documented as part of the query parameters instead.
Example
Consider the following API method:
/**
* Accept query parameters and JSON data in the request body.
*
* @param pager 分页对象 Pagination object
* @param car 汽车对象 Car object
* @return 包含分页信息的通用结果 Common result with pagination details
*/
@PostMapping("/query-and-body")
public CommonResult<BasePager> receiveQueryAndBody(BasePager pager, @RequestBody Car car) {
return CommonResult.ok(pager);
}
In this case:
pager (of type BasePager) should appear in the Query Parameters section of the generated documentation.
car (annotated with @RequestBody) should appear in the Request Body section.
However, the current behavior places both pager and car in the Request Body, which is incorrect.
Contact Details
No response
Version
3.0.9
Plugin
smart-doc-maven-plugin
Build tool version
3.9.6
Jdk version
17
Describe the bug (Bug描述,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)
When a request contains both a
@RequestBody
parameter and an unannotated form parameter (e.g.,BasePager
), the generated API documentation incorrectly places the unannotated parameter (BasePager
) in the request body. However, it should be documented as part of the query parameters instead.Example
Consider the following API method:
In this case:
pager
(of typeBasePager
) should appear in the Query Parameters section of the generated documentation.car
(annotated with@RequestBody
) should appear in the Request Body section.However, the current behavior places both
pager
andcar
in the Request Body, which is incorrect.Expected Behavior (您期望的结果,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)
The generated API documentation should:
BasePager
parameters under Query Parameters.Car
in the Request Body.Current Behavior (当前结果,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)
Body-parameters:
Steps to Reproduce (Bug产生步骤,请尽量提供用例代码。社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)
@RequestBody
parameter and an unannotated form parameter.Possible Solution (Bug解决建议,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)
No response
Context (Bug影响描述,社区已开启国际化推广,请用文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)
No response
Validations