overture-stack / js-lectern-client

JS client for lectern dictionary service
https://overture-stack.github.io/js-lectern-client/
GNU Affero General Public License v3.0
0 stars 0 forks source link

Feature Request: Validation for Unique Field restriction #32

Closed joneubank closed 1 year ago

joneubank commented 1 year ago

This is the first in a series of tickets that will require a refactoring of the client to consider all records of a schema, and all schemas of a dictionary, togehter in the validation step.

This enforces the restriction detailed in the lectern codebase in this issue: https://github.com/overture-stack/lectern/issues/175

The unique restriction expects that each record in the schema has a unique value for the affected field. If the field is not required and the record has an undefined value for this field, then the unique restriction is not considerd.

This restriction can only be applied to the set of records given to the validator. It is therefore the responsibility of the client calling the schema validation client to provide to complete set of records that the uniqueness constraint applies to.