Skip to content

Jakarta @Positive validation is not present in Swagger #3201

@aeiplatform

Description

@aeiplatform
Image
  "components": {
    "schemas": {
      "UnloadAmountRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "transactionReference": {
            "type": "string",
            "maxLength": 40,
            "minLength": 0,
            "pattern": "^[a-zA-Z0-9-]+$"
          }
        },
        "required": [
          "amount"
        ]
      },
public record UnloadAmountRequest(
    @NotNull @Positive BigDecimal amount,
    @Nullable String currency,
    @Nullable String description,
    @Nullable
    @Size(max = 40)
    @Pattern(regexp = "^[a-zA-Z0-9-]+$", message = "Only letters, digits and '-' are allowed")
    String transactionReference
) {
}

https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-bom/3.0.1

Metadata

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