Customer Database · API Governance Rules
Customer Database API Rules
Spectral linting rules defining API design standards and conventions for Customer Database.
15 Rules
error 9
warn 6
Rule Categories
consent
contact
customer
identity
multi
no
properties
schema
soft
Rules
error
customer-record-has-stable-identifier
A customer record must declare a stable, system-assigned identifier. Without one there is nothing for a merge, a consent record, or an identity link to point at. SCIM calls this "id"; vCard calls it "UID".
$
warn
customer-record-declares-external-id
Records that sync with other systems need an identifier assigned elsewhere, or every integration invents its own correlation key. SCIM "externalId".
$
warn
contact-points-are-multi-valued
Every source standard models contact channels as multi-valued and typed. A single scalar "email" field cannot represent a customer with a work and a personal address, and forces lossy merges.
$.properties[?(@property.match(/^(email|phone|telephone|address)$/i))]
warn
multi-valued-attribute-has-primary
A multi-valued contact attribute needs a way to name the preferred entry, or consumers pick arbitrarily. SCIM uses a "primary" boolean; vCard uses PREF.
$..properties[?(@ && @.type == 'array')].items.properties
warn
soft-delete-flag-present
A customer database needs to distinguish a deactivated record from a deleted one, or referential integrity and audit history are lost on every deactivation. SCIM "active".
$
warn
consent-is-modeled
None of SCIM, vCard, or Schema.org models consent, so a customer schema that holds personal data for EU or California residents must model it explicitly or the legal basis for processing is unrecorded and unprovable.
$
error
consent-records-legal-basis
A consent record that does not name its lawful ground cannot be defended. GDPR Article 6(1) enumerates six.
$.properties.consent.items.properties
error
consent-records-purpose
Purpose limitation means consent captured for one purpose does not authorize another. A consent record without a purpose authorizes nothing specific.
$.properties.consent.items.properties
error
consent-records-capture-timestamp
The obligation is to prove what was true at the moment of processing, which requires knowing when permission was given — not when the row was written.
$.properties.consent.items.properties
error
identity-link-declares-method
A link asserted by exact key match and one inferred from weak-attribute similarity carry completely different weight. Without a method, downstream systems cannot tell a fact from a guess.
$.properties.identityLinks.items.properties
error
identity-link-declares-namespace
An identifier without a namespace is not resolvable and cannot be safely compared.
$.properties.identityLinks.items.properties
warn
properties-are-described
Every property needs a description. This is what makes a schema usable by an agent rather than merely valid — a field named "status" with no description is unactionable.
$..properties[*]
error
schema-declares-id
A schema without an $id cannot be referenced, cached, or reused across specs.
$
error
schema-declares-title
$
error
no-plaintext-credential-fields
SCIM defines "password" as write-only and never returned. A customer record schema that exposes a readable credential field is a defect, not a feature.
$.properties[?(@property.match(/^(password|secret|apiKey|token)$/i))]