Skip to content

2.2.30 - @NotNull(jakarta.validation.constraints.NotNull) assigned to a group should treat field as mandatory #4877

Open
@esocas

Description

@esocas

hi! just migrated from 2.2.28 to 2.2.30 and now @NotNull (jakarta.validation.constraints.NotNull) doesn't generate the required parameter when assigning a validation group.

Using the @NotNull alone generates the expected spec and adds it as required.

DTO

import jakarta.validation.constraints.NotNull;
import java.util.List;

public class Request {

  private boolean booleanProperty;

  @NotNull(groups = SomeClass.class, message = "required")
  private NotNullPropertyEnum notNullProperty;

  @CustomValidator(groups = SomeClass.class)
  private List<String> arrayProperty;

2.2.28

  Request:
      required:
      - notNullProperty
      type: object
      properties:
        booleanProperty:
          type: boolean
        notNullProperty:
          type: string
          enum:
          - ENUM1
          - ENUM2
        arrayProperty:
          type: array
          items:
            type: string

2.2.30

    Request:
      type: object
      properties:
        booleanProperty:
          type: boolean
        notNullProperty:
          type: string
          enum:
          - ENUM1
          - ENUM2
        arrayProperty:
          type: array
          items:
            type: string

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