GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — upgrade swagger-core from 2.2.53 to 2.2.54 by Mattias-Sehlstedt · Pull Request #3351 · springdoc/springdoc-openapi

Conversation

@Mattias-Sehlstedt

@Mattias-Sehlstedt Mattias-Sehlstedt commented Sep 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Swagger-core has implemented better handling for dates in swagger-api/swagger-core#5184. This means that some parts of ExtraSchemas from ec43ffb can be removed, since they are now handled upstream.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnasslahsen, bender316, and teq-niq reacted with heart emoji
All reactions
  • ❤️ 3 reactions
@Mattias-Sehlstedt
Mattias-Sehlstedt force-pushed the update-swagger-core branch from 04c6b5e to 02905ac Compare September 6, 2026 10:52
@Mattias-Sehlstedt
Mattias-Sehlstedt marked this pull request as draft September 6, 2026 10:53
@Mattias-Sehlstedt
Mattias-Sehlstedt force-pushed the update-swagger-core branch 2 times, most recently from 70999df to 33e56fd Compare September 6, 2026 11:07
@Mattias-Sehlstedt
Mattias-Sehlstedt marked this pull request as ready for review September 6, 2026 11:11
@Mattias-Sehlstedt
Mattias-Sehlstedt force-pushed the update-swagger-core branch from 33e56fd to 90bc94a Compare September 6, 2026 11:13
@Mattias-Sehlstedt
upgrade swagger-core from 2.2.53 to 2.2.54
d78abd9
@Mattias-Sehlstedt
Mattias-Sehlstedt force-pushed the update-swagger-core branch from 90bc94a to d78abd9 Compare September 6, 2026 11:56
@bnasslahsen
bnasslahsen merged commit 2498ffb into springdoc:main Sep 6, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

bnasslahsen added a commit that referenced this pull request Sep 6, 2026
@bnasslahsen
Merge backport of #3351 - swagger-core 2.2.54
2e7d271
swagger-core now resolves java.time.Duration, LocalTime and OffsetTime
itself (swagger-api/swagger-core#5184), so the corresponding entries of
initExtraSchemas can be dropped.
@bnasslahsen

bnasslahsen commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Merged, thanks @Mattias-Sehlstedt. Full suite is green on both lines.

Backported to spring-boot-3 as well (2e7d271), so 2.9.1 ships swagger-core 2.2.54 too — the initExtraSchemas entries and the app115 / app243 fixtures were identical on that line, so the cherry-pick applied cleanly.

Recorded in the changelog under Changed, flagging the visible consequence for users: Duration and LocalTime now carry format: duration / format: partial-time instead of a bare string.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@didjoman

didjoman commented Sep 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Hi,
I think this feature is creating a small regression when you are using SpringDoc 3.1.0 to generate OAS in version 3.0 instead of 3.1 (i.e. by setting the application property springdoc.api-docs.version=openapi_3_0):

With SpringDoc 3.1.0 generating OAS in version 3.0, it gives this OAS:

"localTime": {
    "type": "string"
},

With SpringDoc 3.1.1 generating OAS in version 3.0, it gives this OAS:

"localTime": {
    "properties": {
        "hour": {
            "format": "int32",
            "type": "integer"
        },
        "minute": {
            "format": "int32",
            "type": "integer"
        },
        "nano": {
            "format": "int32",
            "type": "integer"
        },
        "second": {
            "format": "int32",
            "type": "integer"
        }
    },
    "type": "object"
}

I think we should keep the extra schemas when springDocConfigProperties.getSpecVersion() == SpecVersion.V30or something like that.

Best regards,
Alexandre

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Mattias-Sehlstedt

Mattias-Sehlstedt commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for raising the issue, I will investigate and see how to best restore the correct behavior of not exploding LocalTime (hopefully just some config that is need to ensure that swagger-core resolves it the same for OAS 3.0 and 3.1).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Mattias-Sehlstedt
Mattias-Sehlstedt deleted the update-swagger-core branch September 19, 2026 09:35
@Mattias-Sehlstedt

Mattias-Sehlstedt commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Hi @didjoman, I am unable to reproduce your issue, and to me they both work the same for OAS 3.1 and 3.0. Given that you get

"localTime": {
    "type": "string"
},

and not

"localTime": {
    "type": "string"
    "format": "time-local"
},

then I believe that you might be using an older version of swagger-core. This would then result in your springdoc dropping the custom classes, while you do not pull in the new resolving from swagger-core since you are on an older version.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Mattias-Sehlstedt Mattias-Sehlstedt mentioned this pull request Sep 19, 2026
test: add test for date resolving for OAS 3.0 #3366
Merged
@didjoman

didjoman commented Sep 21, 2026

Copy link
Copy Markdown

Hi, I am really sorry, indeed I had a fixed (older) version of swagger-core overriding springdoc one !
Thanks a lot

Mattias-Sehlstedt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

waelhe pushed a commit to waelhe/app-java-v3 that referenced this pull request Oct 24, 2026
wael.he
fix(contract): freeze the java.time rendering across the 3.1.1 securi…
ceec4aa
…ty upgrade (the #3351 root cause) + retire the stale-from-birth disputes exception

The phase-2b first CI run (40056551784) measured the real 3.1.1 deltas
and falsified the plan's classification: openapi-diff 2.1.7 judged the
#3351 java.time change INCOMPATIBLE -

  [UNCOVERED]    POST /api/v1/providers/{providerId}/availability/rules (key 200)
                (response schema: startTime/endTime property changes)
  [UNREPRESENTABLE] param-change: startTime, endTime (same endpoint)
  [STALE]        POST /api/v1/bookings/{bookingId}/disputes (key 200)

- same tool image as the green 3.1.0 run (2.1.7 == :latest, digest
  sha256:82291446e555): the identical tree under 3.1.0 diffs clean
  against the same v0.1.0 baseline, so every break above is
  springdoc 3.1.1 itself, not the tree and not the baseline flip.
- root cause (official): springdoc CHANGELOG [3.1.1] #3351 - Duration,
  LocalTime and OffsetTime are now resolved by swagger-core 2.2.55
  (format partial-time/duration) instead of being forced to a bare
  string; PR springdoc/springdoc-openapi#3351 removed the three
  customClasses().put(..., PrimitiveType.STRING) entries from
  SpringDocUtils.initExtraSchemas().

Resolution (the gate's own instruction for unrepresentable classes:
"resolve or revert them" - a security release is not reverted):

1. OpenApiJavaTimeSchemaStabilityConfig restores the exact three
   PrimitiveType.customClasses STRING mappings - the identical official
   mechanism springdoc 3.1.0 itself used (customClasses is consulted
   before swagger-core's built-in EXTERNAL_CLASSES registry; measured
   from the 2.2.55 sources). STRING.createProperty() = bare
   StringSchema and STRING.createProperty31() = bare string JsonSchema,
   format-free in both OpenAPI modes - the published contract stays
   frozen while the security fixes land. Version-policy S6 documents
   the deviation (reason/evidence/owner/review date): adopting the
   richer partial-time/duration formats is deferred to a deliberate
   release re-baseline decision, not a dependency bump.

2. The disputes allowlist entry is retired - measured stale from birth.
   It documented a 200 -> 201 spec change that never existed: springdoc
   documents the DEFAULT 200 for ResponseEntity-returning handlers
   regardless of the programmatic ResponseEntity.status(CREATED)
   (verified against the v0.1.0 tag: its open() returned
   ResponseEntity.ok; the spec carried 200 then and carries 200 now).
   The runtime 201 stays; the spec-accuracy gap this exposes (creation
   endpoints whose 201 is documented as 200, fixable per the springdoc
   README via @ResponseStatus) is filed as its own tracked issue with
   its own gate-exception requirements.

3. Governance mirrors corrected with the measured facts: the pom
   comment (the falsified "classifiable" claim replaced by the pin
   rationale), version-policy S1 springdoc row, SYSTEM.md A-10.

Unit coverage: OpenApiJavaTimeSchemaStabilityConfigTest pins the
mapping (fromType == STRING for the three types), the format-free
rendering in both OpenAPI modes, and idempotence.
bnasslahsen added a commit that referenced this pull request Oct 24, 2026
@bnasslahsen
Correct the LocalTime format in the changelog entry of gh-3351
7a1b506
swagger-core describes LocalTime with the time-local format by default,
and OffsetTime with time. partial-time is only used after
PrimitiveType.enablePartialTime().

Signed-off-by: Badr NASS LAHSEN <[email protected]>
bnasslahsen added a commit that referenced this pull request Oct 24, 2026
@bnasslahsen
Correct the LocalTime format in the changelog entry of gh-3351
1e37dac
swagger-core describes LocalTime with the time-local format by default,
and OffsetTime with time. partial-time is only used after
PrimitiveType.enablePartialTime().

Signed-off-by: Badr NASS LAHSEN <[email protected]>
@fleboulch fleboulch mentioned this pull request Nov 16, 2026
Regression with java.time.Duration, LocalTime and OffsetTime (since 3.1.1) #3442
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Mattias-Sehlstedt @bnasslahsen @didjoman
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.