def METHOD_NAME(
    name, serializer_class, search_fields, sort_field_mapping
):
    """
    Returns the schema properties that can be used in in the @extend_schema
    decorator.
    """
    fields = sort_field_mapping.keys()
    all_fields = ", ".join(fields)
    field_name_1 = "field_1"
    field_name_2 = "field_2"
    for i, field in enumerate(fields):
        if i == 0:
            field_name_1 = field
        if i == 1:
            field_name_2 = field
    return {
        "parameters": [
            OpenApiParameter(
                name="search",
                location=OpenApiParameter.QUERY,
                type=OpenApiTypes.STR,
                description=f"If provided only {name} that match the query will "
                f"be returned.",
            ),
            OpenApiParameter(
                name="sorts",
                location=OpenApiParameter.QUERY,
                type=OpenApiTypes.STR,
                description=f"A comma separated string of attributes to sort by, "
                f"each attribute must be prefixed with `+` for a descending "
                f"sort or a `-` for an ascending sort. The accepted attribute "
                f"names are: {all_fields}. For example `sorts=-{field_name_1},"
                f"-{field_name_2}` will sort the {name} first by descending "
                f"{field_name_1} and then ascending {field_name_2}. A sort"
                f"parameter with multiple instances of the same sort attribute "
                f"will respond with the ERROR_INVALID_SORT_ATTRIBUTE "
                f"error.",
            ),
            OpenApiParameter(
                name="page",
                location=OpenApiParameter.QUERY,
                type=OpenApiTypes.INT,
                description="Defines which page should be returned.",
            ),
            OpenApiParameter(
                name="size",
                location=OpenApiParameter.QUERY,
                type=OpenApiTypes.INT,
                description=f"Defines how many {name} should be returned per "
                f"page.",
            ),
        ],
        "responses": {
            200: serializer_class(many=True),
            400: get_error_schema(
                [
                    "ERROR_PAGE_SIZE_LIMIT",
                    "ERROR_INVALID_PAGE",
                    "ERROR_INVALID_SORT_DIRECTION",
                    "ERROR_INVALID_SORT_ATTRIBUTE",
                ]
            ),
            401: None,
        },
    }