Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fleboulch opened this issue Apr 9, 2025 · 0 comments

Comments

@fleboulch
Copy link

fleboulch commented Apr 9, 2025

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

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

@fleboulch fleboulch changed the title Cannot add custom description and example for duration since v2.8.6 Cannot add custom description and example for java.time.duration since v2.8.6 Apr 10, 2025
@fleboulch fleboulch changed the title Cannot add custom description and example for java.time.duration since v2.8.6 Cannot add custom description and example for java.time.Duration since v2.8.6 Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant