Employee Attribute Definition Schemas
Theschema property of an employee-attribute-definition specifies the structure and type of the values the matching employee-attributes can hold.
These schemas use JSON Schema, with two restrictions:
- Only static sub-schemas are allowed
Property types are not freely defined. Each one must reference one of the static schemas exposed at the /lucca-api/schemas endpoint, through
$ref. - Objects are only supported at the root
Nested objects (objects as child properties) are not supported.
The root schema may be of type object, but its properties must still use
$refto point to static sub-schemas.
POST /lucca-api/employee-attribute-definitions), you provide a $ref to the relevant static schema.
When you fetch an employee-attribute-definition, the API embeds the full definition of the referenced static schema, identified by its $id. This embedded schema cannot be sent back as is.
Examples
Taxonomies and Taxonomy Labels
Some attribute values are not primitive types but must be chosen from a user-defined list. These lists are modeled through the taxonomies and taxonomy-labels API endpoints:- Taxonomies represent the named lists themselves (e.g. T-Shirt sizes).
- Taxonomy-labels represent the individual values within a
taxonomy(e.g. Small, Medium, Large).
Taxonomies in Employee Attribute Definitions
When an attribute value is restricted to ataxonomy-label, the definition’s schema references the /lucca-api/schemas/taxonomy-label-reference static schema.
The definition then declares which taxonomy provides the allowed labels, through the taxonomy property at its root, alongside schema. For an object schema, each property restricted to taxonomy labels declares its own taxonomy in propertyDescriptions.
In the T-Shirt size example above:
- The
schemarestricts values to a taxonomy label reference. - The
taxonomy.ididentifies which taxonomy provides the allowed labels (e.g. the list of T-Shirt sizes).