def convert_described_objects(api_describe_objects, sort_key_func=None):
    converted = []
    for obj in api_describe_objects:
        new_fields = {'@id': obj['id'], 'name': obj['name']}
        for field in obj['fields']:
            new_fields[field['key']] = field.get('stringValue', field.get('refValue'))
        converted.append(new_fields)
    if (sort_key_func is not None):
        converted.sort(key=sort_key_func)
    return converted
def convert_described_objects(api_describe_objects, sort_key_func=None):
    converted = []
    for obj in api_describe_objects:
        new_fields = {'@id': obj['id'], 'name': obj['name']}
        for field in obj['fields']:
            new_fields[field['key']] = field.get('stringValue', field.get('refValue'))
        converted.append(new_fields)
    if (sort_key_func is not None):
        converted.sort(key=sort_key_func)
    return converted