Skip to content

feat: validate and export dictionaries as map schemas - #59

Merged
kieronlanning merged 1 commit into
mainfrom
fix-dictionary-validation-serialisation
Oct 22, 2026
Merged

kieronlanning merged 1 commit into
mainfrom
fix-dictionary-validation-serialisation

Conversation

@kieronlanning

Copy link
Copy Markdown
Collaborator

Resolve a collection's per-entry type from IEnumerable, so a Dictionary<,> validates its values instead of its keys. Generated validators report errors at ["Prop", key], honour AllowNulls for values, and follow nested [ZodSchema] value types.

Export dictionaries as { type: object, additionalProperties }, map size constraints to minProperties/maxProperties, and give ZodRecord the same export plus additionalProperties import. JSON Schema import reads an object with additionalProperties as a record.

Bump the package version to 2.4.0.

Resolve a collection's per-entry type from IEnumerable<T>, so a
Dictionary<,> validates its values instead of its keys. Generated
validators report errors at ["Prop", key], honour AllowNulls for
values, and follow nested [ZodSchema] value types.

Export dictionaries as { type: object, additionalProperties }, map
size constraints to minProperties/maxProperties, and give ZodRecord
the same export plus additionalProperties import. JSON Schema import
reads an object with additionalProperties as a record.

Bump the package version to 2.4.0.
@kieronlanning
kieronlanning enabled auto-merge (squash) October 22, 2026 19:03
@kieronlanning
kieronlanning merged commit c8ff02b into main Oct 22, 2026
3 checks passed
@kieronlanning
kieronlanning deleted the fix-dictionary-validation-serialisation branch October 22, 2026 19:09
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