-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Labels
Description
I have an annotation like this
@ApiResponse(
responseCode = "201",
content = @Content(
mediaType = MediaType.APPLICATION_JSON_VALUE,
array =
@ArraySchema(
arraySchema = @Schema(description = "Array description"),
schema =
@Schema(
description = "Item description",
implementation = Item.class
)))))
List<Item> doSomething();The generated schema looks like this:
[
type:array,
description: Array description,
items: [
$ref:#/components/schemas/Item,
description:Array description
]
]
The array description overrides the item description.
If I remove the implementation = Item.class, I get
[
type:array,
description: Array description,
items: [
type:string,
description:Item description
]
]
The item description is there, but the type is wrong. IIUC, It should be deduced from the method signature.
If I remove the whole schema = ... part, I get
[
type:array,
description: Array description
]
The items section is missing completely. At least the type info should be there.
I remember there were similar issues in the components schema generation. This concerns the API response schemas. I assumed they were using the same logic.
Reactions are currently unavailable