Data Type Validation
Data types validate claim values and shape the issuance form. You
configure named instances of the system's base types (STRING, NUMBER,
DATE, and so on), then reference those instances by name when you
create credential and proof schemas. The same configuration applies when
verifying: presented claims are validated against the data types in your
proof schema.
You must configure at least one instance of each base type you plan to use. For all base types and their parameters, see the data types reference.
Wallets use data types differently. See Data Type Extraction.
Basic structure
datatype:
EMAIL:
display: "datatype.email"
type: "STRING"
order: 110
params:
public:
pattern: '^[\w\-\.]+@([\w\-]+\.)+[\w\-]{2,4}$'
placeholder: "abc@abc.com"
autocomplete: true
supportedInputMode: TEXT
error:
en: "Please enter a valid email address"
de: "Bitte geben Sie eine gültige E-Mail-Adresse ein"
Parameters
Validation parameters control how claim values are validated during issuance and verification:
pattern: Regex pattern for string validationmin/max: Range limits for numbers and datesformats: Date/datetime format requirementsaccept: Allowed MIME types for filesfileSize: Maximum file size in bytes
UI parameters shape the issuance form. They are passed to the frontend and are not validated by the backend:
supportedInputMode: Input element type (for exampleTEXT,DATE_PICKER,FILE_UPLOAD)placeholder: Hint text shown in empty fieldsautocomplete: Enables browser autocompleteshowAs: Display mode for imageserror: Custom error message shown when validation fails; supports multiple languages
Multiple instances of one base type
Instances can share a base type while using different validation
rules, UI parameters, and display names. For example, EMAIL alongside a
generic STRING, or BIRTH_DATE alongside a general DATE:
datatype:
STRING:
display: "datatype.string"
type: "STRING"
order: 100
params:
public:
supportedInputMode: TEXT
EMAIL:
display: "datatype.email"
type: "STRING"
order: 110
params:
public:
pattern: '^[\w\-\.]+@([\w\-]+\.)+[\w\-]{2,4}$'
placeholder: "abc@abc.com"
autocomplete: true
supportedInputMode: TEXT
error:
en: "Please enter a valid email address"
DATE:
display: "datatype.date"
type: "DATE"
order: 300
params:
public:
formats: ["date", "datetime"]
preferredFormat: "datetime"
supportedInputMode: DATE_PICKER
BIRTH_DATE:
display: "datatype.birth_date"
type: "DATE"
order: 310
params:
public:
formats: ["date"]
preferredFormat: "date"
min: 1900-01-01
max: "NOW"
supportedInputMode: DATE_PICKER
error:
en: "Please choose a date between 1900-01-01 and today"