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

I hope to support array type in the return value. #421

Closed
sunxue299 opened this issue Feb 6, 2023 · 2 comments
Closed

I hope to support array type in the return value. #421

sunxue299 opened this issue Feb 6, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@sunxue299
Copy link

sunxue299 commented Feb 6, 2023

Motivation(提出这个pr目的)

For example, if I want to return an array of enums, at this point I do not wish to use a List to return the data; instead, I prefer to use an array like State[].
I noticed that the current version 2.4.9 does not support this method. If it returns an array [], its result is type='object' rather than type='array', which leads to the final display being in a non-array format.

It is hoped that support for returning arrays can be included in the new version.
比如我要返回一个枚举的数组,这时我不想使用List返回数据,而是想用State[] 数组这种方式。
我发现目前2.4.9版本不支持该方式,如果返回数组[] 它的结果是type='object'而不是type='array',导致最后是以非数组的方式显示的。

希望能够在新版中支持数组的返回

@sunxue299 sunxue299 added the enhancement New feature or request label Feb 6, 2023
@shalousun
Copy link
Collaborator

shalousun commented Feb 7, 2023

@sunxue299 Have you tried the latest version? The one you are using is quite outdated. It would be best to provide a code snippet that completes a test case.
最新的版本有试过吗,你这个版本已经比较落后了 ,最好提供一个完成测试用例代码片段

@shalousun shalousun added this to the 2.6.5 milestone Feb 9, 2023
@sunxue299
Copy link
Author

sunxue299 commented Feb 11, 2023

@shalousun I tested with the latest version, 2.6.4:
I conducted two tests on the same interface, respectively returning data in array structure for the first test and List structure for the second test.
The JSON results and descriptions returned by smart-doc are shown in the screenshots that follow:
我使用最新版2.6.4测试:
对同一个接口进行2次测试,分别为:第一次返回的数据中为数组结构,第二次返回的数据为List结构。
smart-doc返回的json结果及描述在我后面的截图中:
1
2
3
5
4

@shalousun shalousun changed the title 希望在返回值中支持数组类型 I hope to support array type in the return value. Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants