-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JsonMappingException ("no propery name annotation") when unmarshalling inner case class #29
Comments
Thanks for the bug report. I seem to recall that the reflection mechanism I'm currently using might have issues with inner classes. The reason (IIRC) is that the system uses the ScalaSig system to get run-time type information, which is only available on the top level. Another way of putting it, BarTuple is path-dependent, each instance of BarTuple is tied to a specific Bar. Since, in context, Jackson doesn't know anything about the parent Bar, it may have a hard time doing the right thing in this case, short of some stack trace inspection to see if the parse method is being called from within the parent class of BarTuple. But I'll spend some time looking into what might be done. I also hope that the forthcoming Scala 2.10 will provide better reflection tools for these use cases. |
Have done more reading on this issue, and on the support that is within core Jackson for this use case. The relevant bug report for when support for this was added to Jackson demonstrates that this is possible in the context of deserializing an instance of the containing class. So in the case above, |
Still seeing this issue on 2.3.2 on inner case classes generated by Slick. The following case class is inside a generated trait named Tables
Error: |
Can you open an new issue, and provide a more complete code sample, preferably without a dependency on Slick? |
In the following code, parsing the non-inner case classes with Foo works, but parsing the inner case classes with Bar fails.
Foo parse goes like this:
Bar parse like this:
The text was updated successfully, but these errors were encountered: