Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Relax enum validation in generated models to tolerate unknown/new API values #931

Copy link
Copy link

Description

@vdusek
Issue body actions

Enum fields in the generated models are strict Literal[...] aliases (src/apify_client/_literals.py).
Since every API response is validated with Pydantic, any enum value the platform sends that the
(older) client doesn't know raises a ValidationError and the whole call fails.

This means every new backend enum value breaks clients in the wild until we regenerate and release.
See apify/apify-sdk-python#1032 (missing MCP origin) and the reactive patch #929.

Proposal: emit an open literal Literal[...] | str instead of bare Literal[...] in the
postprocess step (scripts/postprocess_generated_models.py), so unknown values validate while known
members stay as autocomplete hints.

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

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.