Comments (4)
With the latest 0.12 release, the following works ..
describe("Serialization of Long in a bean") {
it("should serialize") {
val m = Person("alexander", Some(27l))
serializer.inPerson should equal(m)
}
}
You don't need the cast as in your example and since a valid instance of Person is obtained, it's always a long that I get back. And in your example, the pattern match erases the type of Option[] - hence I think it's always the first one that matches. What do you get if you reverse case b: and case l: in position ?
Thanks.
from sjson.
Well I couldn't come up with a better way to show this then pattern matching (reversing says "unreachable code").
In my real application I get an exception though, and my debugger shows my that it's really Option[BigDecimal] !
Here is a screenshot: http://imageshack.us/photo/my-images/199/capturehid.png/
Hm, what is the best way to check the runtime type? My skills are not that good yet.
PS: Using Scala 2.9.0 & sjson 0.12
from sjson.
Let me send you another jar, which you can try and see if it solves your problem. Can u pls send me your email address where I can send it .. Thanks ..
from sjson.
As confirmed in the mail, the new jar works. Fixed in the master. Will push 0.13 soon.
from sjson.
Related Issues (20)
- consider using ScalaSigParser to fight type erasure HOT 7
- optionally remove empty objects & arrays from result HOT 4
- custom error message for missing default constructor HOT 1
- SJSON.toJSON() should handle primitive arrays HOT 1
- move to sbt 0.10.1
- Serializing case objects (singleton objects) using sjson HOT 1
- Bug in serializing composite structures like a List within a Map
- Bug in serializing structures where the OptionTypeHint is for a nested value
- Need to distinguish between cases where we have a List of objects or a List of Maps
- Cache for meta-data processing
- Problem in typeclass based serialization using Seq
- some helpers? HOT 2
- String ending with $ is not accepted HOT 3
- Certain double values throw NumberFormatExceptions HOT 1
- Upgrading Dispatch HOT 1
- scala 2.10 version? HOT 6
- scala.MatchError when expecting a tuple but only null is given HOT 1
- ignore missing fields while converting json to case class object HOT 1
- 2.11 release HOT 3
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 sjson.