Skip to content

Commit

Permalink
Fix incompatibility with Jackson 2.17.0-rc1
Browse files Browse the repository at this point in the history
`@JsonSerialize(contentConverter = ...)` is incompatible with property
type `Optional<List<T>>`, which is the detected serialization type
because of the auto-detected getter, because `contentConverter` only
descends one container level.

See: FasterXML/jackson-databind#4413 (comment)
  • Loading branch information
emlun committed Mar 5, 2024
1 parent eb37b61 commit c5a18af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
Changes:

* Dropped dependency on COSE-Java.
* Excluded Jackson version 2.17.0-rc1 from dependency resolution due to an
incompatible regression.
* Fixed incompatibility with Jackson version 2.17.0-rc1.


== Version 2.5.0 ==
Expand Down
5 changes: 1 addition & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ dependencyResolutionManagement {
library("httpclient5", "org.apache.httpcomponents.client5:httpclient5:[5.0.0,6)")
library("slf4j", "org.slf4j:slf4j-api:[1.7.25,3)")

val jacksonVer = version("jackson") {
require("[2.13.2.1,3)")
reject("2.17.0-rc1") // Regression: https://github.com/FasterXML/jackson-databind/issues/4413
}
val jacksonVer = version("jackson", "[2.13.2.1,3)")
library("jackson-bom", "com.fasterxml.jackson", "jackson-bom").versionRef(jacksonVer)
library("jackson-databind", "com.fasterxml.jackson.core", "jackson-databind").versionRef(jacksonVer)
library("jackson-dataformat-cbor", "com.fasterxml.jackson.dataformat", "jackson-dataformat-cbor").versionRef(jacksonVer)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.yubico.fido.metadata;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.net.URL;
Expand Down Expand Up @@ -86,6 +87,9 @@ public Optional<URL> getX5u() {
* @see <a href="https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.6">RFC 7515 §4.1.6.
* "x5c" (X.509 Certificate Chain) Header Parameter</a>
*/
// @JsonIgnore needed because of:
// https://github.com/FasterXML/jackson-databind/issues/4413#issuecomment-1977989776
@JsonIgnore
public Optional<List<X509Certificate>> getX5c() {
return Optional.ofNullable(x5c);
}
Expand Down

1 comment on commit c5a18af

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutation test results

Package Coverage Stats Prev Prev
Overall 81 % 🔻 1293 🔻 / 1583 🔻 82 % 1362 / 1656
com.yubico.fido.metadata 72 % 🟢 233 🔺 / 323 🔹 68 % 222 / 323
com.yubico.internal.util 47 % 🟢 57 🔹 / 120 🔻 46 % 57 / 123
com.yubico.webauthn 86 % 🔻 570 🔻 / 656 🔻 89 % 642 / 720
com.yubico.webauthn.attestation 92 % 🔹 13 🔹 / 14 🔹 92 % 13 / 14
com.yubico.webauthn.data 93 % 🔻 395 🔻 / 423 🔻 93 % 403 / 429
com.yubico.webauthn.extension.appid 100 % 🏆 13 🔹 / 13 🔹 100 % 13 / 13
com.yubico.webauthn.extension.uvm 50 % 🔹 12 🔹 / 24 🔹 50 % 12 / 24
com.yubico.webauthn.meta 0 % 🔹 0 🔹 / 10 🔹 0 % 0 / 10

Previous run: a149b6e - Diff

Detailed reports: workflow run #262

Please sign in to comment.