Contributions
Swagger annotation for "Object" type field with oneOf
I have the following class used as part of a rest request body public static class Area { @Schema(oneOf = { String.class, Number.class }, description = SwaggerAPIMessages.KEY, required = true, example = "") private Object key; @Schema(description = SwaggerAPIMessages.VALUE, required = true, example = "") private double value; public Area() { } ... } when i generate the swagger, i see no reference to the oneOf specification "Area":{"required":["key","value"],"type":"object","properties":{"key":{"type":"object","description":"The category part for a x,y plot","jsonSchema":{"type":"object","description":"The category part for a x,y plot"}},"value":{"type":"number","description":"The value part for an x,y plot","format":"double"}},"description":"The category and value pair for an area chart series"} When i import it intohttps://editor.swagger.io/i get Structural errorat components.schemas.Area.properties.key should NOT have additional properties additionalProperty: jsonSchema Jump to line 404 where 404 is pointing to "key" Anyone have an idea what i'm doing wrong?1.1KViews0likes0Comments