Skip to content

Open API type of sorts parameter for PublicObjectSearchRequest should be mapped to a class  #236

Open

Description

@andrewnguonly

The sorts parameter of the PublicObjectSearchRequest class (all CRM objects) is mapped to the Open API type list[str]. However, the HubSpot API accepts sorts as an array of objects:

sorts = [
    {
        "propertyName": "hs_lastmodifieddate",
        "direction": "DESCENDING",
    }
]

Similar to the filter_groups parameter, the sorts parameter should be mapped to a Sort class with the appropriate attributes.

Example:

openapi_types = {"filter_groups": "list[FilterGroup]", "sorts": "list[Sort]", "query": "str", "properties": "list[str]", "limit": "int", "after": "int"}

Activity

  1. protos-gunzinger commented on Sep 14, 2023

    @protos-gunzinger

    This bit me too, thank you for the solving approach which works!
    I wasted time on this trying to pass in a list of serialized JSON strings, e.g.:
    sort = json.dumps({"propertyName": "lastmodifieddate", "direction": "ASCENDING"}), and then using a list of those...

    Wanted to open an issue too, but found yours then.

    Additionally it seems that contacts (and it seems only contacts), have the differing propertyName lastmodifieddate instead of hs_lastmodifieddate which other classes have...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions