Skip to content

feat: preserve explicit schema ID types - #68

Closed
iamacook wants to merge 2 commits into
mainfrom
aaron-c/feplat-5355-support-schema-specific-string-or-number-entity-ids
Closed

iamacook wants to merge 2 commits into
mainfrom
aaron-c/feplat-5355-support-schema-specific-string-or-number-entity-ids

Conversation

@iamacook

@iamacook iamacook commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fetchium previously exposed every t.id field as string | number, even when an API schema guarantees one concrete ID type. This made consumers add unnecessary narrowing and weakened type safety for entity IDs, query parameters, and related schema outputs.

Changes

  • Replace the bare ID marker with a typed form:
    • t.id(t.string) produces TypeDef<string>
    • t.id(t.number) produces TypeDef<number>
  • Keep t.id() as the explicit compatibility form for schemas that genuinely accept either string or number.
  • Preserve runtime ID marking and normalization behavior for all forms.
  • Add compile-time assertions ensuring string IDs reject numbers and number IDs reject strings.
  • Add runtime parsing coverage for typed string and number entity IDs.
  • Migrate internal schemas and documentation examples to the new API.

@iamacook iamacook self-assigned this Oct 3, 2026
@iamacook
iamacook requested review from a team and pzuraq as code owners October 3, 2026 08:14
@abedell-phantom
abedell-phantom deleted the aaron-c/feplat-5355-support-schema-specific-string-or-number-entity-ids branch October 6, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants