Skip to content

Cannot add custom description and example for java.time.Duration since v2.8.6 #2964

Closed
@fleboulch

Description

@fleboulch

Describe the bug

I cannot anymore override description and example for java.time.Duration since v2.8.6.
It's related to the native support of LocalTime, Duration, ... (#2938).

To Reproduce

version
java version: 21
springboot version: 3.4.4
Springdoc OpenAPI version: org.springdoc:springdoc-openapi-starter-common:2.8.6
springdoc.api-docs.version: openapi_3_0

Steps to reproduce the behavior:

  • Use v2.8.5 and introduce a java.time.Duration property in a response or request obejct with a description and an example (cf the example snippet below)
  • Generate the yaml file
  • Bump to v2.8.6
  • Regenerate the yaml file
  • Observe the diffs

Example snippet

@Schema(
    description = "Frequency to trigger a run (ISO 8601 duration format). If this field is filled, fixedTimesFrequency is null", 
    example = "PT2H"
)
Duration frequency,

Expected behavior

  • I should be able to have a custom description and example

Screenshots

Before (v2.8.5) - valid output
Image

After (v2.8.6) - wrong output
Image

Additional context
It seems to be working fine for java.time.LocalTime

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