def json_fields_of(decorated_collection, fields_from_params = params[:fields])
      return [] if decorated_collection.blank?
      decorated = decorated_collection.first
      index_field_names = decorated.index_field_names.map(&:to_s)
      fields = (fields_from_params.presence || index_field_names).split(/\s*,\s*/).flatten
      fields & index_field_names
    end
def json_fields_of(decorated_collection, fields_from_params = params[:fields])
      return [] if decorated_collection.blank?
      decorated = decorated_collection.first
      index_field_names = decorated.index_field_names.map(&:to_s)
      fields = (fields_from_params.presence || index_field_names).split(/\s*,\s*/).flatten
      fields & index_field_names
    end
If `:fields` parameter is given, only display fields that is in `index_field_names`
 Otherwise, `index_field_names`
 @param decorated_collection [Array<Wallaby::ResourceDecorator>]
 @param fields_from_params [Array<String>]
 @return [Array<String>] a list of field names for json builder