Skip to content

Automatically determine multipleOf from Digits constraint #2384

@Postremus

Description

@Postremus

Right now to document and validate a bigdecimal field with a specific count of fractions I have to write something like this:

@Schema(multipleOf = 0.001)
@Digits(integer = 5, fraction = 3)
@Min(0)
@DecimalMax("99999.999")
public BigDecimal width;

Could maybe the @Schema(multipleOf = 0.001) automaticaly be determined if not specified otherwise?
E.g. @Digits(integer = 5, fraction = 3) -> @Schema(multipleOf = 0.001)

This would, in my opinion, at least cover the most common case where multipleOf is simply used to explicitily state in the doc the fraction count.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions