Hi,
there are different options you have:
- create a JValue manually with either Json4s'
Extraction.decompose or salat's grater
- return the Milestone and let Scalatra's render pipeline handle
the conversion (calls Extraction.decompose internally)
In the case that you use Json4s, you need to add a custom
serializer, so that Json4s knows how to handle ObjectId instances.
Here is a sample:
https://gist.github.com/dozed/5631680
Regards,
Stefan