-
Notifications
You must be signed in to change notification settings - Fork 17
Consider adding snake_case to camelCase conversion for Literal parameter values #700
Copy link
Copy link
Open
Labels
t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.
Milestone
Description
Summary
Currently, Literal type parameters that map directly to API query parameters use camelCase values, matching the API convention. For example:
sort_by: Literal['createdAt', 'stats.lastRunStartedAt'] | None = 'createdAt'
ownership: Literal['ownedByMe', 'sharedWithMe'] | None = NoneThis works, but it's not idiomatic Python — users would expect snake_case values in the Python interface.
Proposal
Introduce a conversion mechanism that allows snake_case values in the Python-facing API and converts them to camelCase before sending to the Apify API. For example:
# Python interface
ownership: Literal['owned_by_me', 'shared_with_me'] | None = None
# Converted to `ownedByMe` / `sharedWithMe` in the HTTP requestContext
This was identified during the review of #696 — see this comment.
Should be considered before v3.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.
Type
Fields
Give feedbackNo fields configured for issues without a type.