Skip to content

@NotEmpty is being ignored in 2.8.6 and does not create required attribute #2946

Open
@adgan

Description

@adgan

Describe the bug

After updating to version 2.8.6 of [Framework/Library Name], the @NotEmpty annotation on request DTOs no longer generates the required attribute in the OpenAPI file. This behavior worked as expected in the previous version 2.8.5.

To Reproduce
Steps to reproduce the behavior:

  1. using @NotEmpty
  2. generating OpenAPI yml file
  3. looking at the required list
  • What version of spring-boot you are using?
    3.4.4
  • What modules and versions of springdoc-openapi are you using?
    springdoc-openapi-starter-webmvc-ui @ 2.8.6
  • What is the actual and the expected result using OpenAPI Description (yml or json)? yml
  • Provide with a sample code (HelloController) or Test that reproduces the problem
public class ExampleRequestDto {
  @Schema(
      name = „test“,
      description = „test“,
      example = „test“,
  )
  @NotEmpty
  private final String test;
}

Expected behavior

Sample code should add a

      required:
      - test

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions