Skip to content

[codex] support polymorphic embeds - #6

Merged
fishtreesugar merged 1 commit into
cdc-fixesfrom
codex/polymorphic-embed-support
Jun 8, 2026
Merged

[codex] support polymorphic embeds#6
fishtreesugar merged 1 commit into
cdc-fixesfrom
codex/polymorphic-embed-support

Conversation

@fishtreesugar

@fishtreesugar fishtreesugar commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

Adds support for mathieuprog/polymorphic_embed in Strukt-generated schemas.

Changes

  • Adds polymorphic_embed as a dependency.
  • Supports polymorphic_embeds_one/2 and polymorphic_embeds_many/2 inside Strukt.defstruct blocks.
  • Routes polymorphic embed casting through PolymorphicEmbed.cast_polymorphic_embed/3 while preserving existing regular embed behavior.
  • Extends parameter transformation for polymorphic embeds, including field source: mappings and type changes.
  • Updates generated typespecs to include polymorphic embed union types.
  • Keeps from_json/1 compatible with polymorphic embeds by preserving JSON object keys as strings.

Validation

  • mix test passes: 48 tests.

@fishtreesugar
fishtreesugar marked this pull request as ready for review June 8, 2026 02:57
@fishtreesugar
fishtreesugar merged commit 1daf1fe into cdc-fixes Jun 8, 2026
8 checks passed
@fishtreesugar
fishtreesugar deleted the codex/polymorphic-embed-support branch June 8, 2026 02:57
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