json.array! @facets do |facet_obj| json.name facet_obj.name json.count facet_obj.count json.included_objs do formatted_objs = facet_obj.included_objs.map do |obj| @formatter.call(obj, scrivito_user, controller.view_context) end json.merge!(formatted_objs) end end