Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Parsing of case class with Strings starting with "{" fails #75

Open
darkfrog26 opened this issue Nov 11, 2012 · 0 comments
Open

Parsing of case class with Strings starting with "{" fails #75

darkfrog26 opened this issue Nov 11, 2012 · 0 comments

Comments

@darkfrog26
Copy link

There is a valid scenario where a String may start with "{" when parsing a case class but I get the following exception because it decides that it must be an Object:

com.codahale.jerkson.ParsingException: Can not deserialize instance of java.lang.String out of START_OBJECT token

The defined type being String should tell the parser to ignore the type and simply put the data into the String.

Is there an annotation or something I can supply to my case class to tell Jerkson to just push the value in without trying to parse it?

Example:

case class Test(name: String)

parse[Test]("""{ "name": "{hello}" }""") <-- will throw an exception because it starts with "{"
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant