Skip to main content

Employee Attribute Definition Schemas

The schema 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:
  1. 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.
  2. 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 $ref to point to static sub-schemas.
When you create an employee-attribute-definition (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 a taxonomy-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 schema restricts values to a taxonomy label reference.
  • The taxonomy.id identifies which taxonomy provides the allowed labels (e.g. the list of T-Shirt sizes).