Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 correct parameter documentation for @RequestBody and unannotated form parameters #967

Conversation

linwumingshi
Copy link
Collaborator

@linwumingshi linwumingshi commented Nov 26, 2024

Fixed an issue where unannotated parameters (e.g., BasePager) were incorrectly documented as part of the request body in API documentation when used alongside a @RequestBody parameter. These parameters are now correctly documented as query parameters.

  • Add ApiParamEnum to categorize API parameters (PATH, QUERY, BODY)
  • Implement logic to determine parameter type based on annotations and HTTP method
  • Update API documentation generation to use new parameter categorization
  • Refactor ApiMethodDoc and ApiParam classes for better parameter management
  • Improve handling of form data and query parameters in API requests

Closes #965

…ated form parameters

Fixed an issue where unannotated parameters (e.g., BasePager) were incorrectly documented as part of the request body in API documentation when used alongside a @RequestBody parameter. These parameters are now correctly documented as query parameters.

- Add ApiParamEnum to categorize API parameters (PATH, QUERY, BODY)
- Implement logic to determine parameter type based on annotations and HTTP method
- Update API documentation generation to use new parameter categorization
- Refactor ApiMethodDoc and ApiParam classes for better parameter management
- Improve handling of form data and query parameters in API requests

Closes TongchengOpenSource#965
Copy link

Thanks for your this PR. 🙏
Please check again for your PR changes whether contains any usage configuration change such as Add new configuration, Change default value of configuration.
If so, please add or update documents(markdown type) in docs/ for repository smart-doc-group/smart-doc-group.github.io

In addition, if you have added new features, please provide example code in the repository smart-doc-group/smart-doc-example-cn. This will help other users understand how to use the new features.


感谢您提交的PR。 🙏
请再次查看您的PR内容,确认是否包含任何使用方式 配置参数的变更,如:新增配置参数修改默认配置等操作。
如果是,请确保在提交之前,在仓库smart-doc-group/smart-doc-group.github.io中的docs/目录下添加或更新文档(markdown格式)。

另外,如果您添加了新功能,请在仓库smart-doc-group/smart-doc-example-cn中提供示例代码。这将帮助其他用户了解如何使用新功能。

@shalousun shalousun added this to the 3.10 milestone Nov 26, 2024
@shalousun shalousun merged commit 29678d3 into TongchengOpenSource:master Nov 26, 2024
12 of 13 checks passed
@linwumingshi linwumingshi deleted the fix/requestbody-queryparam-docs branch November 26, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect Parameter Location for Unannotated Parameters in API Documentation
2 participants