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

Missing array type when using @ArraySchema #4641

Closed
paulrutter opened this issue Mar 27, 2024 · 2 comments
Closed

Missing array type when using @ArraySchema #4641

paulrutter opened this issue Mar 27, 2024 · 2 comments
Assignees

Comments

@paulrutter
Copy link

paulrutter commented Mar 27, 2024

Since we upgraded from 2.2.11 to 2.2.21, the output when using @ArraySchema is no longer correct.
We're outputting 3.1 via openAPI31: true.

The output in JSON misses "type": "array".
See example on https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Annotations#arrayschema

Relevant annotations used:

content = @Content(
        mediaType = APPLICATION_JSON,
        array = @ArraySchema(schema =  @Schema(implementation = BulkResultBean.class)),
        examples = {
                @ExampleObject(
                    name = "Example bulk response",
                    description = "Example bulk response",
                    value = "description...."
                )
       }
})

Left is with 2.2.11, right with 2.2.21.
image

I see several mentions of fixes in array schema in the changelog, but i doubt this output is now correct.

@micryc micryc self-assigned this May 23, 2024
@micryc
Copy link
Contributor

micryc commented May 23, 2024

Hi @paulrutter Are you still experiencing this issue ? I tried to reproduce with core 2.2.22 version and it looks like type shows up in specification. For now I am gonna close this ticket, if issue still appears for you, feel free to reopen

            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/BulkResulBean"
                  }
                },
                "examples" : {
                  "Example bulk response" : {
                    "description" : "Example bulk response",
                    "value" : "description...."
                  }
                }
              }
            }
          

@micryc micryc closed this as completed May 23, 2024
@paulrutter
Copy link
Author

I will check it out @micryc and reopen if needed.

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

2 participants