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

JAX-RS array Request Payload cannot generate documentation properly. #666

Closed
pky920216344 opened this issue Nov 24, 2023 · 2 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@pky920216344
Copy link

pky920216344 commented Nov 24, 2023

Your Environment(您的使用环境)

  • smart-doc version: 3.0.0
  • plugin version (e.g. smart-doc-maven-plugin or smart-doc-gradle-plugin): 3.0.0
  • build tool version(maven or gradle): maven
  • jdk version: 1.8
  • javax.ws.rs version: 2.1.0

Expected Behavior(您期望的结果)

@POST
@Path("/foo")
@Consumes({MediaType.APPLICATION_JSON})
@Produces({MediaType.APPLICATION_JSON})
public void create(List<Foo> list) {

}

The above code API can be accessed normally and should generate the correct API documentation.
以上代码API能正常访问,应该生成正确的API文档

Current Behavior(当前结果)

[ERROR] 
java.lang.RuntimeException: Jaxrs rest can't support binding Collection on method create

Possible Solution(bug解决建议)

  1. Support for array Request Payload.

Steps to Reproduce (Bug产生步骤,请尽量提供用例代码)

  1. Create a Springboot Jax-RS project

  2. Configure the smart-doc-plugin

  3. Generate documentation

  4. 创建一个Springboot Jax-RS 项目

  5. 配置好smart-doc-plugin

  6. 生成文档

Context(Bug影响描述)

The current situation is that we are completely unable to generate API documentation.
It is suggested to make enhancements so that an error in one method does not affect the generation of API for other methods.
现在的情况是完全无法生成API文档。
建议做一下增强,及时某个方法错误不影响其它方法的API生成。

@pky920216344 pky920216344 added the bug Something isn't working label Nov 24, 2023
@shalousun
Copy link
Collaborator

shalousun commented Nov 29, 2023

Pull requests are welcome to participate in the co-construction.
欢迎提pr参与共建

@shalousun shalousun added this to the 3.0.2 milestone Dec 22, 2023
@shalousun shalousun changed the title JAX-RS 数组Request Payload无法正常生成文档 JAX-RS array Request Payload cannot generate documentation properly. Mar 10, 2024
@shalousun
Copy link
Collaborator

shalousun commented Mar 28, 2024

@pky920216344 We used the following example for testing, but we were unable to reproduce the results.
我们写用例做测试,无法复现

   /**
     * Test
     * @param list
     */
    @POST
    @Path("/foo")
    @Consumes({MediaType.APPLICATION_JSON})
    @Produces({MediaType.APPLICATION_JSON})
    public void create(List<Person> list) {
        System.out.println(list);
    }
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants