View source on GitHub

Base field datatype validation

PDC fields are validated on the basis of baseField.dataType (separate from inputType, see more here). This document provides more detail on how different data types are validated within PDC.

Approach

PDC does not modify, normalize, trim, or otherwise change any of the data that it receives, stores, and retrieves. Instead, data validation provides users with the expectation of well-formatted data only for field values accompanied by isValid: true.

This means all values with leading or trailing whitespace will be considered invalid.

Where possible, we have used existing libraries for data validation.

Data types

Data type Validator Notes
boolean
number
string ajv
email ajv
url ajv
date ajv Full date per RFC3339
date_time ajv Must include timezone
currency validator
phone_number validator Extensions must be preceded by ;ext= per RFC3966 or commas
file Read more
—————- ———– ——————————————————————-

This content was automatically generated from GitHub. Any edits made on WordPress will be lost.