atproto utils for zig zat.dev
atproto sdk zig

json.extractAt should report which field failed and why #1

open
opened by zzstoatzz.io

When using extractAt to parse a struct from JSON, if a field can't be parsed (e.g., type mismatch), the function returns null with no indication of what went wrong.

Reproduction: Try parsing a JSON object with "action": "create" into a struct with action: SomeEnum. The extraction silently fails.

Suggested improvement: Return or log diagnostic info like:

extractAt failed: field 'action' - expected enum SomeEnum, got string "create"

This would save significant debugging time when working with external JSON APIs (like TAP) where the exact field types aren't always documented.

sign up or login to add to the discussion
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:xbtmt2zjwlrfegqvch7fboei/sh.tangled.repo.issue/3mbsoiujn7b22