0
SCALA リストまたはシーケンスをSprint @RestControllerに戻すにはどうしたらいいですか?リスト戻り値は、が正しくシリアル化されていません。Spring SCALA Rest Restroller内のリスト
結果は次のとおりです。
[GET] http://localhost:9090/devices
{"empty":false,"traversableAgain":true}
は、私は適切なRESTのためにジャクソンObjectMapper com.fasterxml.jackson
をインポートし、リスト上の結果のシリアル化を取得する必要がありますか?
マイRestControllerは次のようになります。
@RestController
class DeviceController {
var devices = Set[Device]()
@RequestMapping(value = Array("/devices"), method = Array(RequestMethod.GET))
def accounts() : List[Device] = devices.toList
}