Skip to content

feat(typegen): emit resource descriptors and use them for hydration - #217

Merged
Erlend Ellefsen (erlendellefsen) merged 1 commit into
nextfrom
feat/typegen-resource-descriptor
Sep 2, 2026
Merged

feat(typegen): emit resource descriptors and use them for hydration#217
Erlend Ellefsen (erlendellefsen) merged 1 commit into
nextfrom
feat/typegen-resource-descriptor

Conversation

@erlendellefsen

Copy link
Copy Markdown
Collaborator

Summary

Typegen emits a descriptor per resource (type, attributes, toOne, toMany) next to its interface. client.resource(Article) infers the type and fills what the wire omits: stripped attributes as null, un-included
relationships as null / []. fields() takes a descriptor. Type helpers now classify nullable relationships and primitive arrays correctly, with a type-level probe test. Strict sample enables UseResourceAttributeTypeNames.

New typegen flag: --client-import <specifier>.

How to test

dotnet test JsonApiToolkit.TypeGen.Tests
just typegen --check
cd clients/typescript && deno task test
deno task test:contract   # needs both samples/ContractApi instances running

@erlendellefsen
Erlend Ellefsen (erlendellefsen) merged commit 8497e3d into next Sep 2, 2026
6 checks passed
@erlendellefsen
Erlend Ellefsen (erlendellefsen) deleted the feat/typegen-resource-descriptor branch September 2, 2026 13:54
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.

1 participant