Repository navigation
upgrade swagger-core from 2.2.53 to 2.2.54 - #3351
Conversation
04c6b5e to
02905ac
Compare
70999df to
33e56fd
Compare
33e56fd to
90bc94a
Compare
90bc94a to
d78abd9
Compare
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.
|
Merged, thanks @Mattias-Sehlstedt. Full suite is green on both lines. Backported to Recorded in the changelog under Changed, flagging the visible consequence for users: |
|
Hi, 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 Best regards, |
|
Thanks for raising the issue, I will investigate and see how to best restore the correct behavior of not exploding |
|
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. |
|
Hi, I am really sorry, indeed I had a fixed (older) version of swagger-core overriding springdoc one ! |
…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.
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 <badr.nasslahsen@gmail.com>
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 <badr.nasslahsen@gmail.com>
Swagger-core has implemented better handling for dates in swagger-api/swagger-core#5184. This means that some parts of
ExtraSchemasfrom ec43ffb can be removed, since they are now handled upstream.