Skip to content

Add Schemecto.map_of/1,2 for maps of arbitrary keys - #1

Open
zachallaun wants to merge 1 commit into
dashbitco:mainfrom
zachallaun:za/typed-objects
Open

Add Schemecto.map_of/1,2 for maps of arbitrary keys#1
zachallaun wants to merge 1 commit into
dashbitco:mainfrom
zachallaun:za/typed-objects

Conversation

@zachallaun

@zachallaun zachallaun commented Aug 14, 2026

Copy link
Copy Markdown

May end up using Schemecto for some internal tooling, but wanted maps with arbitrary keys but known values. Completely understand if you'd rather keep the implementation in this repo minimal, but figured I'd share the code back just in case. 🙂

map_of/2 mirrors one/2 and many/2 with nested field definitions and a :with validation function. map_of/1 accepts a bare type for values. Both emit JSON Schema objects using additionalProperties.

Assisted-by: Claude:Fable-5

map_of/2 mirrors one/2 and many/2 with nested field definitions and a
:with validation function. map_of/1 accepts a bare Ecto type for the
values. Both emit JSON Schema objects with additionalProperties.
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