Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andrewnguonly opened this issue Aug 22, 2023 · 1 comment
Assignees

Comments

@andrewnguonly
Copy link

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"}
@protos-gunzinger
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants