Skip to content

Empty default values are ignored #4838

Open
@westito

Description

Empty default values (@Schema(defaultValue = "")) are not included into generated OpenAPI yaml file.

Related code:

if (StringUtils.isNotBlank(schema.defaultValue())) {

Empty values are simply ignored, but many code generation tools are rely on this value. For ex. in Dart generator when no default value provieded, the field became required at code level.

The defaultValue in @Schema annotation should be nullable and passing empty value means include in generated schema.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions