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

Do you have a plan to support multiple request example and mutiple response example #932

Open
3 tasks done
jay763190097 opened this issue Oct 23, 2024 · 4 comments
Open
3 tasks done

Comments

@jay763190097
Copy link

Is your feature request related to a problem? Please describe.(关于这个PR的描述,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

Do you have a plan to support multiple request example and mutiple response example

Basic example (PR的用例,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

can support multiple request example and multiple response example

Describe the solution you'd like (描述您想要的解决方案,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

can support multiple request example and multiple response example

Describe alternatives you've considered (描述你考虑过的替代方案,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

No response

Additional context (其他背景信息,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

No response

Validations

  • Read the docs. (请先阅读官方文档)
  • Read the Contributing Guidelines. (请先阅读官方文档·贡献指南)
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. (检查是否存在报告相同错误的问题,以避免产生重复)
@linwumingshi
Copy link
Collaborator

linwumingshi commented Oct 28, 2024

Hi @jay763190097

Thanks for your issues ! Could you please provide more details on the use case for supporting multiple request and response examples? Understanding your specific scenario will help us better evaluate and implement this feature.

@jay763190097
Copy link
Author

jay763190097 commented Oct 31, 2024

@linwumingshi , Actually, It's the same meaning with example in Open API. In Open API, we have request example and response example these two concept, it's helpful for testing different scenarios in debug mode.

@shalousun
Copy link
Collaborator

@linwumingshi , Actually, It's the same meaning with example in Open API. In Open API, we have request example and response example these two concept, it's helpful for testing different scenarios in debug mode.

Currently, smart-doc only supports auto-generating random values or using mock data. If multiple test cases are involved, the data source for these test cases might be more complex to write. You can propose some of your implementation solutions.

@jay763190097
Copy link
Author

jay763190097 commented Nov 1, 2024

@linwumingshi Understand. In my opinion, we can add a tag @Example name type(body, header, request parameter, path parameter) value,
if it's a json body, value can like this file(classpath:test_scenario1_success.json).
But this one, I recommender that we only display examples on the debug page, and can choose different example name to test it.

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

No branches or pull requests

3 participants