in app/controllers/Api.scala [424:444]
def itemJson[T <: IndexedItem](
item: T,
expand: Boolean = false,
label: Option[Label] = None,
filter: Matchable[JsValue] = ResourceFilter.all
)(implicit request: RequestHeader, writes: Writes[T]): Option[JsValue] = {
val json = Json.toJson(item).as[JsObject] ++ Json.obj(
"meta" -> Json.obj(
"href" -> item.call.absoluteURL(),
"origin" -> label.map(_.origin)
)
)
if (filter.isMatch(json)) {
val filtered =
if (expand) json
else JsObject(json.fields.filter(List("arn") contains _._1))
Some(filtered)
} else {
None
}
}