Skip to content

Consider adding snake_case to camelCase conversion for Literal parameter values #700

Closed

Description

@vdusek

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 = None

This 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 request

Context

This was identified during the review of #696 — see this comment.

Should be considered before v3.

Activity

  1. added
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Apr 7, 2026
  2. added this to the 3.0 milestone on Apr 7, 2026
  3. self-assigned this
    on Apr 17, 2026
  4. added a commit that references this issue on Apr 17, 2026
    eb70b64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions