Skip to content

@Schema(defaultValue) inside @Parameter on @BeanParam field loses type and enum #2595

Description

@Pepo48

When a @BeanParam field has @Parameter(schema = @Schema(defaultValue = "ASC")) on an enum-typed field, SmallRye produces a schema with only the default value, type and enum are lost.

I would expect SmallRye to pick up the type and enum values from the Java field type and combine them with the explicitly provided default value.

Example:

public static class QueryOptions {
    @QueryParam("sortOrder")
    @Parameter(description = "Sort direction", schema = @Schema(defaultValue = "ASC"))
    SortOrder sortOrder;  // enum with ASC, DESC
}

# Expected:
schema:
  type: string
  enum: [ASC, DESC]
  default: ASC

# Actual:
schema:
  default: ASC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions