Skip to content

Seeming parameter name consideration in jackson-module-scala 2.12.0+ causes new exceptions #505

Closed
@blast-hardcheese

Description

@blast-hardcheese

Related PR that triggered this investigation: guardrail-dev/guardrail#927
Reproducing repo: https://github.com/blast-hardcheese/jackson-module-scala-bug#first-issue

README from reproducing repo

Repo to show ObjectMapper with DefaultScalaModule 2.12.0+ causes some new and creative runtime errors.

First issue

In the first case, methods annotated with @JsonCreator with the same name but different types now require that the parameter names be different, otherwise

Conflicting property-based creators: already had explicitly marked creator [method regression.ConflictingJsonCreator#apply(long)],
encountered another: [method regression.ConflictingJsonCreator#apply(java.lang.String)]

Second issue

In the second case, all @JsonCreator's must have different parameter names from the member of the value class, otherwise:

Cannot construct instance of `regression.ConflictingMember` (although at least one Creator exists):
no int/Int-argument constructor/factory method to deserialize from Number value (10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions