Description for array schema is being ignored when generating OpenAPI 3.1
I have the following Java code:
class Street {
@ArraySchema(schema = @Schema(implementation = House.class, description = "A house in the street"),
arraySchema = @Schema(description = "The houses in the street"))
public List<House> houses;
}
When generating OpenAPI 3.0, I get
Street:
type: object
properties:
houses:
type: array
description: The houses in the street
items:
$ref: "#/components/schemas/House"
The item description is missing, but that's another issue (https://github.com/swagger-api/swagger-core/issues/3900). However, when I generate OpenAPI 3.1, I get
Street:
type: object
properties:
houses:
type: array
items:
$ref: "#/components/schemas/House"
description: A house in the street
Now, the item description is there, but the array description is missing.
I have the same problem.
See issue where I described the problem: https://github.com/springdoc/springdoc-openapi/issues/2953
From OpenAPI 3.0:
...
"components": {
"schemas": {
"ClassName": {
"type": "object",
"properties": {
"fieldName1": {
"type": "string",
"description": "A text here1."
},
"fieldName2": {
"type": "array",
"description": "A text here2.",
"items": {
"type": "string"
}
}
}
}
...
And in OpenAPI 3.1:
...
"components": {
"schemas": {
"ClassName": {
"type": "object",
"properties": {
"fieldName1": {
"type": "string",
"description": "A text here1."
},
"fieldName2": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
...
Doesn't seem to be fixed in 2.2.31.
Sill missing in 2.2.34.
#4942 has a failing test but I haven't managed to come up with a fix yet.
#4942 has a potential fix.
title actually has the same issue.
I think that the bug was introduced in 7294019dc203b3995671084fd2b6b51525af1ea8.
@frantuma, can you advise?
Sill an issue in 2.2.37, fix available in #4942
@jochenberger appreciate your effort and input here! The fix will be included in the incoming release version.