Comments (4)
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.
from jackson-module-scala.
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, BarTuple
cannot be deserialized alone, but if BarParse
where a bean type, that contained a BarTuple
as a value, then that would be deserialzed properly. The test added in fe15b83 demonstrates that this works correctly.
from jackson-module-scala.
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
case class User(id: Int, email: String, password: String, firstName: String, lastName: String)
Error:
Caused by: java.lang.IllegalArgumentException: Argument #0 of constructor [constructor for db.Tables$User, annotations: [null]] has no property name annotation; must have name when multiple-paramater constructor annotated as Creator at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findValueInstantiator(BasicDeserializerFactory.java:287) at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:266) at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:168) at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:401) at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:350) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:263) ... 30 more
from jackson-module-scala.
Can you open an new issue, and provide a more complete code sample, preferably without a dependency on Slick?
from jackson-module-scala.
Related Issues (20)
- Update 2.15 release notes with Scala changes HOT 2
- Release 2.14.3 HOT 2
- Upgrade to Scala 3.3.0
- Release 2.15.1 HOT 1
- support deserializing Scala Iterators HOT 1
- Release 2.15.2 HOT 2
- Dependency on .class and .tasty files causes footprint bloat for GraalVM NativeImage HOT 5
- Failure to deserialise scala Map when default typing is activated HOT 10
- DefaultScalaModule breaks deserialization of java classes HOT 13
- 2.16 jackson-databind deserialization changes have broken support for the scala.util.Either class HOT 1
- Collection of case classes deserialized as Collection of Map2 HOT 4
- Release 2.15.3 HOT 4
- Release 2.16.0-rc1 HOT 1
- error when deserializing yaml HOT 2
- Release 2.16.0 HOT 2
- release jackson-module-scala v2.12 for Scala 2.10 HOT 2
- Release 2.16.1 HOT 1
- Update `2.17` branch to `2.17.0-rc1-SNAPSHOT` HOT 2
- Release 2.15.4 HOT 1
- Release 2.17.0-rc1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jackson-module-scala.