Skip to content

fix: auto-exclude relator fields from attributes#114

Merged
jrandolf merged 1 commit intomainfrom
fix/issues-77-and-30
Mar 11, 2026
Merged

fix: auto-exclude relator fields from attributes#114
jrandolf merged 1 commit intomainfrom
fix/issues-77-and-30

Conversation

@jrandolf
Copy link
Collaborator

@jrandolf jrandolf commented Mar 11, 2026

Summary

When a Relator is defined for a field, that field is now automatically excluded from serialized attributes under the default projection: null. Previously the field appeared in both attributes and relationships, which is incorrect per the JSON:API spec. Users had to explicitly set a projection to work around this.

Test plan

  • All 105 existing tests pass
  • New regression test added (test/issue-77.test.ts)

Closes #77

🤖 Generated with Claude Code

When a Relator is defined for a field, that field is now automatically
excluded from serialized attributes under the default projection (null).
Previously the field appeared in both attributes and relationships,
which is incorrect per the JSON:API spec.

Closes #77

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jrandolf jrandolf force-pushed the fix/issues-77-and-30 branch from fa0b5e0 to e1ae5d7 Compare March 11, 2026 04:54
@jrandolf jrandolf changed the title fix: relator fields excluded from attributes, async metaizers and linkers fix: auto-exclude relator fields from attributes Mar 11, 2026
@jrandolf jrandolf merged commit 4ce44c2 into main Mar 11, 2026
1 check passed
@jrandolf jrandolf deleted the fix/issues-77-and-30 branch March 11, 2026 04:56
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.

[BUG] Related fields are included in attributes by default

1 participant