I'm having trouble finding a solution to documenting a Map<String, List<Thing>> properly using Swagger annotations and Open API. Thing is annotated properly, but I cannot find the correct combination of properties in @Schema to document the key and value properly.
I have this property:
@Schema(
description = "Groups and the things that belong to them.",
example = "{\"group1\": [{\"name\":\"foo\", ...}, ...], ...}"
requiredMode = REQUIRED)
private Map<String, List<Thing>> groups;
Key is the group name, value is a collection of things belonging to the group. While defining example kind of helps in the documentation, it shows up as a string of JSON in the example Redocly produces. I don't like that as it's not really accurate.
I've tried various things like additionalPropertiesSchema = Thing.class but that loses representation of the List that's nested inside the map's value.