swagger-core
swagger-core copied to clipboard
Why does Schema(description="foo") change generated openapi enum type to type: object?
An enum property with Schema description generates an incorrect open api yaml specification, with 'allOf' and 'type: object' that should not be there,
@Data
public class ColumnNameListRequest {
@Schema(description="foo")
private DataGranularity granularity;
}
generates,
ColumnNameListRequest:
type: object
properties:
granularity:
allOf:
- $ref: '#/components/schemas/DataGranularity'
- type: object
description: foo
but if I remove description="foo" the generated signature looks correct,
@Data
public class ColumnNameListRequest {
@Schema(description="foo")
private DataGranularity granularity;
}
generates,
ColumnNameListRequest:
type: object
properties:
granularity:
$ref: '#/components/schemas/DataGranularity'
Why does the generated openapi type depend on whether I supply a "description" or not?