现在我试图解析JSON案例类,我有一个问题。 这是我的JSON字符串:斯卡拉映射Json和案例类
{"book_id":"1", "book_name":"Skype", "author_name":"bla bla", "author_country":"Poland"}
而且我有2个case类:
case class Book(bookId: String, bookName: String){}
case class Author(authorNam: String, authorCountry: String){}
那么,如何解析JSON分为2类? 输出将是:
Book(1, Skype)
Author(bla bla, Poland)
非常感谢您的帮助。
非常感谢你 –