Describe the bug
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.
Screenshots
No response
Additional context
No response
Code of Conduct
Describe the bug
The
uniqueItemspost-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_itemsinjects a validator into every matching class, even when only one class declaresuniqueItems: truein its schema.To Reproduce
Firstwheretagsis an array withuniqueItems: true.First.tagsandSecond.tags.uniqueItemspost-processing step.Expected behavior
Expected Behavior
The
uniqueItemsvalidator should only be injected into the class whose schema explicitly declaresuniqueItems: true.If multiple classes contain list fields with the same name:
uniqueItems: truemust reject duplicate values.uniqueItemsconstraint.Screenshots
No response
Additional context
No response
Code of Conduct