json4s Questions

1

Solved

I have following Scala console session for json4s, where I am trying to extract String value from a parsed json: scala> import org.json4s._ import org.json4s._ scala> import org.json4s.nativ...
Jankowski asked 3/9, 2015 at 14:28

2

Solved

How can I map a json with underscore to a camelCase field in a case class? import org.json4s.jackson.JsonMethods.parse import org.json4s.DefaultFormats object Testing { implicit val formats = De...
Instructive asked 6/8, 2014 at 19:29

0

I've run into an issue with attempting to parse json in my spark job. I'm using spark 1.1.0, json4s, and the Cassandra Spark Connector, with DSE 4.6. The exception thrown is: org.json4s.package$Ma...
Colombia asked 16/4, 2015 at 6:2

1

In my Scala Spray.io application, I would like to turn some Joda LocalTime and LocalDate objects into JSON. This is apparently done by adding JodaTime support from Json4s to the DefaultFormats as f...
Thinker asked 4/2, 2015 at 19:30

1

Solved

In json4s examples and documentation I often see the idioms compact(render(jval)) and pretty(render(jval)) I do not think I have actually seen an example with compact or pretty applied direct...
Terrill asked 28/10, 2014 at 2:30

1

Solved

I have this JSON that is returned from a REST-service I'm using. { "id": "6804", "signatories": [ { "id": "12125", "fields": [ { "type": "standard", "name": "fstname", "value": "John" },...
Reinaldo asked 13/1, 2015 at 13:43

3

Solved

I'm learning Json4s library. I have a json fragment like this: { "records":[ { "name":"John Derp", "address":"Jem Street 21" }, { "name":"Scala Jo", "address":"in my sweet dream" } ] } ...
Vicennial asked 9/1, 2015 at 7:49

2

Solved

Even after reading: Scala, problem with a jar file, I'm still a bit confused. I am trying to import some packages into my Scala file, and the interpreter is not recognizing them even after adding t...
Haruspex asked 2/7, 2013 at 15:54

1

Solved

I am using json4s to work with JSON objects in my Scala code. I want to convert JSON data to an internal representation. The following learning test illustrates my problem: "Polimorphic deseraili...
Parisparish asked 22/9, 2014 at 18:37

1

Solved

I am currently trying to extract the information from a json array using json4s (scala). An example data is as follows: val json = """ [ {"name": "Foo", "emails": ["[email protected]", "[e...
Chain asked 21/11, 2014 at 1:0

2

Solved

Is it possible to make json4s not to throw exception when required field is missing ? When I "extract" object from raw json string it throws exception like this one org.json4s.package$MappingExce...
Waldemar asked 11/4, 2013 at 8:23

3

Solved

I am experimenting with the json4s library (based on lift-json). One of the things I would like to do is to parse a JSON string into an AST, and then manipulate it. For example, I would like to up...
Vang asked 22/6, 2013 at 19:34

1

Solved

I am using the facebook graph API and the responses look similar to this: { "data": [ { "id": "311620272349920_311718615673419", "from": { "id": "1456046457993048", "name": "Richard Ettins...
Montes asked 31/8, 2014 at 12:13

2

Solved

Let's assume I have a case class with the following setup: case class Place(id:java.util.UUID, name:String) I can write a (working!) serializer for this type as follows: class placeSerializer e...
Khufu asked 24/4, 2014 at 19:8

1

Suppose I have an enumeration or sealed group of case objects as follows: sealed abstract class Status case object Complete extends Status case object Failed extends Status case object Pending...
Sora asked 27/6, 2014 at 1:17

1

Solved

I have some source object src and would like to get a JValue from it. All the examples and documentation for json4s seem to revolve around getting a JSON-encoded string, like so: def encodeJson(sr...
Trichina asked 28/4, 2014 at 18:23

1

Solved

I am writing a Customer Serializer. In that Serializer I would like to somehow say: "and this thing you already know how to serialize". My current approach looks like that: import org.json4s.na...
Tiedeman asked 10/4, 2014 at 15:31

1

Solved

I would like to support a couple of different content types submitted to the same URL: e.g: application/x-www-form-urlencoded, multipart/form-data, application/json I would like to do something...
Deltoro asked 3/4, 2014 at 1:43

2

Solved

I have a json with some fields and I want to check if some of them are present. I'm extracting the value and testing it against JNothing, but it is too verbose: val json: JValue = ... val jsonIsT...
Phosphoresce asked 9/2, 2014 at 21:48

2

Solved

How do you create Json object with values of different types ? I'm using spray-json Here is the code val images : List[JsObject] = fetchImageUrls(url).map((url: String) => { JsObject(List( ...
Markham asked 1/5, 2013 at 6:46

© 2022 - 2024 — McMap. All rights reserved.