Describe the bug
- From springdoc 2.8.0 and newer, fields that are marked as nullable via
@Schema(nullable = true) no longer show as nullable: true in the generated OpenAPI and swagger UI.
- This issue was introduced after 2.7.0. Tested with 2.8.5 and 2.8.0 which both exhibit the same bug.
To Reproduce
Steps to reproduce the behavior:
- Java 21, spring-boot 3.4.3
- springdoc-openapi-starter-webflux-ui 2.8.5
- Create a class and annotate all fields with @Schema(nullable = true)
- Expose this class via a get endpoint
- Inspect OpenAPI JSON or YAML. No fields will be nullable in OpenAPI spec
Sample OpenAPI YAML from 2.8.0 and 2.8.5
components:
schemas:
MyType:
properties:
id:
format: int32
type: integer
Expected behavior
Sample OpenAPI YAML from 2.7.0
components:
schemas:
MyType:
properties:
id:
format: int32
nullable: true
type: integer
Describe the bug
@Schema(nullable = true)no longer show asnullable: truein the generated OpenAPI and swagger UI.To Reproduce
Steps to reproduce the behavior:
Sample OpenAPI YAML from 2.8.0 and 2.8.5
Expected behavior
Sample OpenAPI YAML from 2.7.0