Questions tagged [lift-json]

the lift-json parsing and formatting utilities for JSON

A JSON abstract syntax tree (AST) providing the following features:

  • Fast JSON parser
  • LINQ style queries
  • Case classes can be used to extract values from parsed JSON
  • Diff & merge
  • DSL to produce valid JSON
  • XPath like expressions and HOFs to manipulate JSON
  • Pretty and compact printing
  • XML conversions
  • Serialization
  • Low level pull parser API

Github: https://github.com/lift/lift/tree/master/framework/lift-base/lift-json/

130 questions
1
vote
0 answers

Using json-lift with play, omitted Option fields break deserialization

My understanding is that json-lift supports Option fields out of the box. Here is a sample object definition: class TopicModel ( var id: Option[Long], var name: String, val slug: String, var imageUrl: Option[String] ) {} I then use…
gregsilin
  • 287
  • 1
  • 7
1
vote
1 answer

Is there a way to get lift-json to auto-convert numeric string fields to numeric type?

I'm using lift-json to deserialize simple objects from a POST request. Example: {"id": "35", "name": "My topic", "slug": "my-slug", "imageUrl": "http://foo.bar/image.png"} class definition: class Topic(var id: Option[Long], var name: String, val…
gregsilin
  • 287
  • 1
  • 7
1
vote
0 answers

circe-json and scala neted objects processing

I have to create a json in the below format using scala and circe-json encoder classes { "actions":{ "action1":{ "read":[ { "parq":[ { "str":"" }, { …
narman12
  • 43
  • 8
1
vote
1 answer

Liftweb works in Object but not in Class

This code works: import net.liftweb.json.{DefaultFormats, parse} object JsonTest { def main(args: Array[String]): Unit = { implicit val formats = DefaultFormats // Brings in default date formats etc. case class RawObject(filters:…
Benjamin
  • 3,350
  • 4
  • 24
  • 49
1
vote
0 answers

How to escape 'is a reserved keyword and cannot be used as field name' error in Spark SQL and Structured Streaming?

Currently when I used Structured Streaming v2.1.0 + Kafka v0.10 for real time logs processing, i got Exception in thread "main" java.lang.UnsupportedOperationException: `package` is a reserved keyword and cannot be used as field name My task…
1
vote
1 answer

NoSuchMethodError while trying to generate JSON strings from a Scala Map using Lift-JSON

Getting NoSuchMethodError while trying to generate JSON strings from a Scala Map using Lift-JSON . Was trying to execute the following program from scala cookbook package com.sample import net.liftweb.json.JsonAST import…
user5281490
1
vote
1 answer

Scala How to convert JsonAST.JValue to a type?

I have an angular app that POSTs a request to the server like so: $scope.downloadPartDetails = (parts, e) -> req = { method: 'POST', url: '/downloads/partdetails', headers: { 'Content-Type': "application/json;…
An Illusion
  • 769
  • 1
  • 10
  • 24
1
vote
1 answer

accessing elements of a lift-json parsed object in scala

I have parsed a json using lift-json parser in scala.I did this to parse the json object: var parsedstring =parse(x) The class of "parsedstring" is net.liftweb.json.JsonAST$JObject Then I did this: var parsedmap =…
Ravi Ranjan
  • 353
  • 1
  • 6
  • 22
1
vote
1 answer

Scala/Spark: NoClassDefFoundError: net/liftweb/json/Formats

I am trying to create a JSON String from a Scala Object as described here. I have the following code: import scala.collection.mutable._ import net.liftweb.json._ import net.liftweb.json.Serialization.write case class Person(name: String, address:…
Paul Reiners
  • 8,576
  • 33
  • 117
  • 202
1
vote
1 answer

spark-core 1.6.1 & lift-json 2.6.3 java.lang.NoClassDefFoundError

I have a Spark application which has a sbt file just like below. It works on my local machine. But when I submit it to EMR running Spark 1.6.1, an error occured like below: java.lang.NoClassDefFoundError: net/liftweb/json/JsonAST$JValue I am using…
Barbaros Alp
  • 6,405
  • 8
  • 47
  • 61
1
vote
1 answer

Lift-Json Extracting from JSON object

I have this code below: object Test { def main(args: Array[String]) { val sparkConf = new SparkConf().setAppName("Spark").setMaster("local[2]") val sc = new SparkContext(sparkConf) val ssc = new…
user5228393
1
vote
0 answers

Converting from a lift-json AST to a json4s AST

I'm a bit amazed that I can't find any other information on this. As I understand it json4s is the same thing as lift-json, just decoupled from lift. Cool, great. I have a library I'm using, with a class I can't modify, that can produce a lift-json…
Sushisource
  • 611
  • 6
  • 17
1
vote
1 answer

Scala object to json string using lift-json

I have a scala class like class metrics{ private var _moduleId: String = "" private var _blah1: String = "" private var _metadata: Map[String, String] = Map() def moduleId: String = _moduleId def moduleId_(value: String): Unit = { …
1
vote
1 answer

Finding correct jar file to work with scala example

I am trying to do an example here and (I believe) I am running into issues because my version of Lift is wrong. My specific error is: java.lang.ClassNotFoundException: com.thoughtworks.paranamer.Paranamer How do I know which version of Lift I should…
Rilcon42
  • 9,584
  • 18
  • 83
  • 167
1
vote
1 answer

lift json :Custom serializer for java 8 LocalDateTime throwing mapping exception

I have a class named child2 which i want to serialize and deserialize my class contains a LocalDateTime attribute for which i have to write a custom serializer i tried with the two solutions but both was throwing exceptions here is my code Solution…
swaheed
  • 3,671
  • 10
  • 42
  • 103
1 2 3
8 9