Skip to content

feat(schema-writer): add record support#124

Merged
ssilvius merged 2 commits intomainfrom
feat/schema-writer-record-support
Feb 27, 2026
Merged

feat(schema-writer): add record support#124
ssilvius merged 2 commits intomainfrom
feat/schema-writer-record-support

Conversation

@ssilvius
Copy link
Contributor

Summary

  • Add "record" to SUPPORTED_TYPES in field-emitter
  • Implement emitRecord() that calls emitField on metadata.valueDescriptor
  • Emits z.record(z.string(), <value-expr>) (key type assumed z.string())
  • Handles scalar values, enum values, optional records

Closes #118

Test plan

  • 3 new unit tests (scalar value, enum value, optional)
  • 1 new round-trip test
  • All 306 tests passing
  • Lint + typecheck clean

🤖 Generated with Claude Code

ssilvius and others added 2 commits February 26, 2026 18:23
Add z.record(z.string(), <value>) emission to the schema-writer.
Records now support scalar and enum values, with optional/nullable
wrapping. Key type is assumed to be z.string() since the introspection
module does not preserve the key type in FieldMetadata.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move metadata mismatch test to record fields block,
move writer emission test to multiple field types block.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ssilvius ssilvius force-pushed the feat/schema-writer-record-support branch from 99c8df4 to fb01e40 Compare February 27, 2026 02:24
@ssilvius ssilvius merged commit 9a4bf7f into main Feb 27, 2026
2 checks passed
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.

feat(schema-writer): add record support

1 participant