【发布时间】:2018-08-24 18:30:02
【问题描述】:
我正在根据以下建议使用 Spring Boot 和 Scala 构建 Rest API。我成功地调用了 Scala 中的方法,但案例类没有按照设计的方式工作。
当我尝试使用 net.liftweb.json 创建 Json 时,我得到了额外的字符串 "$outer":{}。我不想在我的输出中添加这个额外的字符串。
请注意,spring boot 需要的是类而不是对象。我怀疑这可能是一个问题。你能帮我解决这个问题吗?
我的案例类如下所示:
case class BasicSrch(size: String, query: Match)
错误输出
{"$outer":{},"size":"10","query":{"$outer":{},"match":{"$outer":{},"_all":{"$outer":{},"query":"SNOW","operator":"and"}}}}
预期输出
{"size":"10","query":{"match":{"_all":{"query":"VALLE","operator":"and"}}}}
【问题讨论】:
标签: json scala spring-mvc spring-boot