Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 lift-json 将 JSON 提取到案例类中。这是我的案例类:
case class Person(name: String, age: Int)
这是json
{ "name": "Some Name", "age": 24, type: "Student" }
如何将type字段提取到实例中Person?
type
Person
json.extract[Person]
反引号允许您使用保留名称。
case class Person(name:String, age:Int, `type`:String)