play-json Questions
1
I have many value classes that make up a larger object case class.
final case class TopLevel(
foo: Foo,
bar: Bar
)
final case class Foo(foo: String) extends AnyVal
final case class Bar(bar: Str...
Spiroid asked 10/3, 2022 at 14:35
3
Solved
I have a recursive class defined :
case class SettingsRepository(id: Option[BSONObjectID],
name: Option[String],
children: Option[List[SettingsRepository]])
with a JSON implicit format as below ...
Confiscatory asked 8/6, 2015 at 14:40
3
Solved
Given the following JSON:
{
"field1": "value1",
"field2": "",
"field3": "value3",
"field4": ""
}
How do I get tw...
Spinal asked 1/7, 2014 at 14:35
1
Solved
In the following example (scala 2.11 and play-json 2.13)
val j ="""{"t":2.2599999999999997868371792719699442386627197265625}"""
println((Json.parse(j) \ "t").as[BigDecimal].compare(BigDecimal("2.2...
Carnet asked 17/3, 2019 at 14:36
2
Solved
I have a set of case objects that inherits from a trait as below:
sealed trait UserRole
case object SuperAdmin extends UserRole
case object Admin extends UserRole
case object User extends User...
Weir asked 27/1, 2017 at 14:54
4
Solved
I need to get a simple JSON serialization solution with minimum ceremony. So I was quite happy finding this forthcoming Play 2.2 library. This works perfectly with plain case classes, e.g.
import ...
Aggi asked 10/6, 2013 at 10:33
2
Solved
I am trying to marshall and un-marshall an Option[String] field to and from JSON. For my use-case, a None value should be marshaled as "null". Here is the code I have:
import org.scalatest.{FlatSp...
1
Solved
I have an empty case class corresponding to an HTTP GET request:
case class GetFoo() extends MyQueryRequest {
// ...
}
and each message has a companion object with describes its implicit JSON w...
Bolanos asked 29/3, 2017 at 14:16
2
Solved
I need help to parse a json string into scala class using playJson
I wrote a formatter but I don't know how to handle the nested arrays.
Where Document Case class is
case class Document(content:...
1
Solved
I need to save a Json Field as a column of my Play Framework Model. My table parser in DAO is
class Table(tag: Tag) extends Table[Model](tag, "tablename") {
implicit val configFormat = Json.form...
Tosha asked 26/11, 2016 at 14:34
1
© 2022 - 2024 — McMap. All rights reserved.