swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

Missing array type when using @ArraySchema

Open paulrutter opened this issue 1 year ago • 0 comments

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.

paulrutter avatar Mar 27 '24 15:03 paulrutter