Persistentにあるモデルは次のとおりです。
Tip
text Text
created_at UTCTime
updated_at UTCTime
title Text
category_id CategoryId
および関連するToJSONインスタンス (使用できませんでしたderiveJSON):
instance ToJSON Tip where
toJSON (Tip text created_at updated_at title category_id) = object ["text" .= text, "created_at" .= created_at, "updated_at" .= updated_at, "title" .= title, "category_id" .= category_id]
ここでも Tip の ID を JSON 化したいことを除いて、これはほぼ正しいですが、モデルのどこにもありません! どうすればいいですか?EntityValからに移動する方法はありますEntityKeyか?