Content Types
Content types are semantic hints you can attach to a field via the contentType
property. They do not change how data is stored or validated, but they inform UI
rendering and automatic data generation by describing the kind of value a field
holds.
Setting a Content Type
Add contentType when defining a field:
{ "name": "author", "type": "string", "contentType": "full_name" }
Content Type Reference
Snaapi supports 37 content types organized into 8 categories.
Text
General-purpose text formats.
| Content Type | Description |
|---|---|
plain_text |
Unformatted plain text |
rich_text |
Formatted text (HTML or similar) |
markdown |
Markdown-formatted text |
code |
Source code or code snippet |
Person
Names and identity information.
| Content Type | Description |
|---|---|
first_name |
A person's first / given name |
last_name |
A person's last / family name |
full_name |
A person's full display name |
username |
A user handle or screen name |
Contact
Communication and contact details.
| Content Type | Description |
|---|---|
email |
Email address |
url |
Web URL |
phone |
Phone number |
Location
Geographic and address data.
| Content Type | Description |
|---|---|
address |
Street address |
city |
City name |
state |
State or province |
zip_code |
Postal / ZIP code |
latitude |
Geographic latitude coordinate |
longitude |
Geographic longitude coordinate |
country_code |
ISO country code |
Media
Files, images, and media references.
| Content Type | Description |
|---|---|
image_url |
URL pointing to an image |
file_url |
URL pointing to a downloadable file |
avatar_url |
URL pointing to a user avatar |
mime_type |
MIME type string (e.g. image/png) |
Business
Organization and professional data.
| Content Type | Description |
|---|---|
company_name |
Name of a company or organization |
job_title |
Professional job title |
description |
General-purpose description text |
Data
Numeric, formatted, and identifier values.
| Content Type | Description |
|---|---|
color |
Color value (hex, RGB, etc.) |
currency |
Monetary amount |
percentage |
Percentage value |
age |
A person's age |
quantity |
Count or quantity |
rating |
Numeric rating or score |
slug |
URL-friendly identifier |
ip_address |
IPv4 or IPv6 address |
language_code |
ISO language code |
Specialized
Domain-specific formats.
| Content Type | Description |
|---|---|
cron_expression |
Cron schedule expression |
semantic_version |
Semantic versioning string (semver) |