Open xenoterracide opened 3 years ago
Improving exception messages would be great. Will leave here in case someone has time and itch to work on this! I may be able to do something for this whenever I get a chance to work on introspection changes for 2.13, but targeted changes might be easier.
Introspection rewrite did not get in 2.13. :-(
I already figured this out, but it took hours when it could have taken minutes. The issue wasn't very googleable, as most results don't even say that you can do constructor injection without
@JsonProperty
, and the others are using spring-boot and don't mention that you need to registerParameterNamesModule
.The first error message, without
@JsonCreator
is annoying because it's something like "Unable to find Creator" blah blah, "no default constructor" blah blah. I suspect it could find its way to the next exception if it checked that I only had one constructor with arguments. That might be hard though, so I forgive it. At least it might help to suggest annotating with@JsonCreator
in that message.When you do annotate with that, the message seems like a lie
I realize reading this now that it means that it has no
@JsonProperty
, I originally assumed that it meant that the parameter name was missing, and thus I didn't have-parameters
which didn't make sense. The simplest solution in my mind would be to expand this message to say something like