Skip to content

PQA034 — Person profile field has two definitions

Two person_profiles slot types in one access-model.yaml declare the same field name with different definitions.

A profile template stores its values per adapter type, keyed by field name. One field name therefore holds one value for every slot type of the adapter.

person_profiles:
  - slot_type: Card
    fields:
      - name: priority          # one stored value ...
        type: enum
        values: ["High", "Low"]
        description: "Card priority"
  - slot_type: Password
    fields:
      - name: priority          # ... cannot have two descriptions
        type: enum
        values: ["High", "Low"]
        description: "PIN priority"

Why the build refuses this

The server cannot show one field with two schemas. The profile template editor builds one schema per adapter type. Two definitions of one name leave it no correct choice, so the adapter type cannot be edited.

Two device records cannot share one value by accident. When the device stores a value in each record, the profile needs one field per record. Otherwise a change for one record silently changes the other.

How to fix it

Give each slot its own field name when the device stores a separate value per record, for example card_priority and pin_priority.

Make both declarations identical when the slots share one value on purpose. The check compares type, values, required, category, description, default, range, length, pattern and sensitivity.

What is not reported

A field name repeated with an identical definition. The slots share one field and one stored value.

If you disagree with a report

Do not suppress it. A wrong report is a bug in the check — report it with the YAML that triggered it.