Skip to content

Instantly share code, notes, and snippets.

@pollingj
Last active December 19, 2015 00:29
Show Gist options
  • Save pollingj/5869073 to your computer and use it in GitHub Desktop.
Save pollingj/5869073 to your computer and use it in GitHub Desktop.
class LocationsController(val swagger:Swagger) extends HullCityPlanApiStack with JacksonJsonParsing with JacksonJsonSupport {
implicit val jsonFormats = DefaultFormats+ new ObjectIdSerializer
var locationService = new LocationService()
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true)
...
}
{"location" :
[{
"id":{"$oid":"51cac8d84728c7471e101317"},
"name":"test1",
"coordinates":[],
"jobs":100
}]
}
{
"JArray":[{
"JObject":{
"id":{"JObject":{"$oid":{"JString":"51caca2e472829f13a8b6dc1"}}},
"name":{"JString":"test1"},
"coordinates":{"JArray":[]},
"jobs":{"JInt":100}
}
}]
}
[
{
"id":{"$oid":"51cac8d84728c7471e101317"},
"name":"test1",
"coordinates":[],
"jobs":100
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment