Skip to content

fix: return JSON scalars from local Actor input with their real type - #1243

Merged
vdusek merged 4 commits into
apify:masterfrom
peterolkhov:codex/preserve-local-json-input-types
Nov 13, 2026
Merged

vdusek merged 4 commits into
apify:masterfrom
peterolkhov:codex/preserve-local-json-input-types

Conversation

@peterolkhov

@peterolkhov peterolkhov commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Local INPUT and INPUT.json files containing JSON scalars need JSON metadata to preserve their values and types. This sets the MIME type directly after validation and keeps bare non-JSON INPUT as bytes, including non-UTF-8 content. Explicit .json and .txt validation stays in place.

Tests cover six representative JSON values for both filenames, plus plain and UTF-16 byte input with exact-byte and metadata checks. Locally on macOS/Python 3.13.14: uv run --frozen --no-sync poe check-code passed formatting, lint, type checks, and all 755 unit tests. The focused file passed all 19 tests.

Metadata files written by earlier SDK versions are not rewritten. If a local JSON scalar input already comes back as a string, delete its metadata file (INPUT.json.__metadata__.json or INPUT.__metadata__.json) once.

Prepared with Codex assistance.

@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Nov 9, 2026
@janbuchar
janbuchar self-requested a review November 10, 2026 09:07
@vdusek vdusek changed the title fix: preserve JSON scalar input types in local storage fix: return JSON scalars from local Actor input with their real type Nov 13, 2026

@vdusek vdusek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vdusek
vdusek merged commit a54ada0 into apify:master Nov 13, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants