Attribute Types Reference
This document describes the seven attribute types supported by notifito, their wire formats, validation rules, and matching behavior.
Overview
notifito uses a closed set of seven attribute types. This set is shared by three consumers:
- Widget: Renders form inputs based on type
- Server-side validation: Validates submissions against type rules
- Matching engine: Compares subscription and event attributes
Adding an eighth type requires teaching all three consumers about it, so the set does not grow.
The Seven Types
1. enum
Single or multiple selection from a predefined list of options.
Wire Format (Scalar):"42"
["41", "42"]
{
"key": "size",
"label": "Size",
"type": "enum",
"options": ["40", "41", "42", "43"],
"required": true,
"matchable": true,
"multiple": false
}
- Must be one of the declared options
- If
multiple: true, must be an array of options - If
multiple: false, must be a single string - Empty arrays are rejected
- Single: Exact equality
- Multiple: Set intersection (at least one value matches)
- Single:
dropdown - Multiple: Multi-select or checkboxes
2. integer
Whole numbers with optional range constraints.
Wire Format (Scalar):42
{"min": 40, "max": 44}
{
"key": "guests",
"label": "Number of Guests",
"type": "integer",
"required": true,
"matchable": true
}
- Must be a whole number (no decimals)
- Strings are coerced to integers
- Interval:
minandmaxare optional (nullable) - Interval:
minmust not exceedmax
- Scalar: Exact equality
- Interval: Value falls within range (inclusive)
- Open interval:
{"min": null, "max": 4}matches anything ≤ 4 - Open interval:
{"min": 2, "max": null}matches anything ≥ 2
3. decimal
Floating-point numbers with optional range constraints.
Wire Format (Scalar):10.5
{"min": 10.0, "max": 12.5}
{
"key": "price",
"label": "Price",
"type": "decimal",
"required": true,
"matchable": true
}
- Must be numeric (integer or float)
- Strings are coerced to floats
- Interval: Same rules as integer
- Scalar: Exact equality
- Interval: Value falls within range (inclusive)
4. date
ISO 8601 date values.
Wire Format:"2026-09-01"
{
"key": "appointment",
"label": "Appointment Date",
"type": "date",
"required": true,
"matchable": true
}
- Must be ISO 8601 format:
YYYY-MM-DD - Must be a valid date (e.g.,
2026-02-30is rejected) - Time component is not allowed
- Exact equality only
- No range comparison (use
date_rangefor ranges)
5. date_range
Start and end dates representing a range.
Wire Format:{
"from": "2026-09-01",
"to": "2026-09-05"
}
{
"key": "stay",
"label": "Stay Dates",
"type": "date_range",
"required": true,
"matchable": true
}
- Both
fromandtomust be ISO 8601 dates frommust not be afterto- Either bound can be null (open-ended)
- Bare date string is normalized to
{"from": d, "to": d}
- Overlap: Ranges must overlap
- Touching ranges (e.g., Sep 1-5 and Sep 5-10) match
- Open-ended:
{"from": null, "to": "2026-09-05"}matches anything ending before Sep 5
- Two date pickers (from and to)
6. boolean
True/false values.
Wire Format:true
{
"key": "gift_wrap",
"label": "Gift Wrap",
"type": "boolean",
"required": false,
"matchable": true
}
- Must be
trueorfalse - Strings like
"yes","1","true"are rejected nullis treated as absent (not a value)
- Exact equality:
truematchestrue,falsematchesfalse
7. text
Free-text values with a maximum length.
Wire Format:"Leave at door"
{
"key": "notes",
"label": "Special Notes",
"type": "text",
"required": false,
"matchable": false
}
- Must be a string
- Maximum 500 characters
nullis treated as absent
- Exact equality (case-sensitive)
- Typically
matchable: falsefor free-text notes
Wire Format Summary
| Type | Scalar Form | Interval Form | Nullable |
|---|---|---|---|
enum | "42" | — | No |
enum (multiple) | ["41", "42"] | — | No |
integer | 42 | {"min": 40, "max": 44} | Yes (bounds) |
decimal | 10.5 | {"min": 10, "max": 12.5} | Yes (bounds) |
date | "2026-09-01" | — | No |
date_range | {"from": "...", "to": "..."} | — | Yes (bounds) |
boolean | true | — | No |
text | "hello" | — | No |
Matching Behavior Summary
| Type | Matching Rule |
|---|---|
enum | Exact equality (single) or set intersection (multiple) |
integer | Exact equality or range containment |
decimal | Exact equality or range containment |
date | Exact equality |
date_range | Range overlap |
boolean | Exact equality |
text | Exact equality (case-sensitive) |
Wildcard Rules
- Subscription empty: Consumer doesn't care → Match anything
- Event empty: Seller forgot field → Wildcard, match everything
This ensures sellers never under-notify due to missing attributes.
Schema Definition
Attribute Definition Structure
{
"key": "size",
"label": "Size",
"type": "enum",
"options": ["40", "41", "42"],
"required": true,
"matchable": true,
"multiple": false
}
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Lowercase snake_case identifier |
label | string | Yes | Display label |
type | string | Yes | One of the seven types |
options | array | Conditional | Required for enum type |
required | boolean | No | Default: false |
matchable | boolean | No | Default: true |
multiple | boolean | No | Default: false (enum only) |
Key Rules
- Must be lowercase snake_case
- Must start with a letter
- Can contain letters, numbers, underscores
- Examples:
size,guest_count,date_range
Examples by Industry
E-commerce (Sneaker Store)
[
{
"key": "size",
"label": "Size",
"type": "enum",
"options": ["40", "41", "42", "43"],
"required": true,
"matchable": true,
"multiple": false
},
{
"key": "color",
"label": "Color",
"type": "enum",
"options": ["red", "blue", "black"],
"required": false,
"matchable": true,
"multiple": false
}
]
Hospitality (Hotel)
[
{
"key": "stay",
"label": "Stay Dates",
"type": "date_range",
"required": true,
"matchable": true
},
{
"key": "guests",
"label": "Number of Guests",
"type": "integer",
"required": true,
"matchable": true
}
]
Healthcare (Clinic)
[
{
"key": "appointment",
"label": "Appointment Date",
"type": "date",
"required": true,
"matchable": true
},
{
"key": "practitioner",
"label": "Practitioner",
"type": "enum",
"options": ["Dr Ng", "Dr Okafor", "Any"],
"required": false,
"matchable": true
}
]