json2caseclass icon indicating copy to clipboard operation
json2caseclass copied to clipboard

Add option for fully typesafe generation

Open sherifkandeel opened this issue 6 years ago • 1 comments

To follow a complete typesafe approach, leaf level values should NOT be converted to primitive types. but instead, to value classes

e.g.

{
  "id": 2,
  "name": "Steve Nash",
  "score": 4.23
}

should be

case class R00tJsonObject(id: Id, name: Name, score: Score)
case class Id (value: Int) extends AnyVal
case class Name(value: String) extends AnyVal
case class Score(value: Double) extends AnyVal

sherifkandeel avatar Sep 27 '18 19:09 sherifkandeel

I'd like to see this as a button on the analysis panel, next to the Optional checkbox (maybe in addition to the full-auto approach described above).

When modifying the type name of a field in the analysis area for a primitive type, it should generate the value class wrapper for it

Daenyth avatar Dec 01 '20 17:12 Daenyth