json2caseclass
json2caseclass copied to clipboard
Add option for fully typesafe generation
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
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