You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: uniqueItems validators are incorrectly injected into unrelated classes with same-named fields #60
The uniqueItems post-processing logic currently collects constrained fields as a global set of field names.
When multiple generated classes contain list fields with the same name, inject_unique_items injects a validator into every matching class, even when only one class declares uniqueItems: true in its schema.
To Reproduce
Define a schema for First where tags is an array with uniqueItems: true.
Generate a module containing both First.tags and Second.tags.
Run the uniqueItems post-processing step.
Inspect the generated classes.
Expected behavior
Expected Behavior
The uniqueItems validator should only be injected into the class whose schema explicitly declares uniqueItems: true.
If multiple classes contain list fields with the same name:
The class declaring uniqueItems: true must reject duplicate values.
Classes without the constraint must not receive the validator.
Unconstrained fields must continue to accept duplicate values.
The generated module must contain exactly one validator for each scoped uniqueItems constraint.
Activity
damaz91 commentedon Aug 4, 2026
Fixed by #61 - thanks!