#
if fields:
fields_list = fields.split(',') # Разделяем значения параметра fields по запятой
logger.info(fields_list)
filtered_response = [{field: item.get(field) for field in fields_list} for item in response]
return filtered_response
else:
return response