Skip to content

Schema Types

Tags define structured schemas — each field in a tag schema has a type that determines what values are valid. Thogits stores 7 field types. All fields are nullable by default: a null value or a missing key in field_values is always valid regardless of type.

TypeSchema JSONValue JSONValidation
String"String""hello"Must be a JSON string
Number"Number"42 or 3.14Must be a JSON number (f64)
Boolean"Boolean"true or falseMust be a JSON boolean
Date"Date""2024-01-15" or "2024-01-15T10:30:00"YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS
Reference"Reference""01JQXK6V9XCSV5K9Z1MQSK5RBT"Valid ULID; target thogit must exist
Select{"type":"Select","variants":[...]}{"variant":"Name"}Variant name must match a defined variant
MultiSelect{"type":"MultiSelect","variants":["A","B"]}["A","B"]All items must be valid variant names; no duplicates

The simplest type. Accepts any JSON string value.

PropertyDetail
Schema definition"String"
Valid valuesAny JSON string: "hello", "", "a long paragraph..."
Invalid values42, true, ["a"]
// Schema
{ "title": "String" }
// Value
{ "title": "My First Thogit" }

Accepts any JSON number. Stored as a 64-bit float (f64). Integers and decimals are both valid.

PropertyDetail
Schema definition"Number"
Valid values42, 3.14, -100, 0, 1e10
Invalid values"42" (string), true, null counts as missing
// Schema
{ "priority": "Number" }
// Value
{ "priority": 3 }

Accepts JSON true or false only. The strings "true" and "false" are not valid.

PropertyDetail
Schema definition"Boolean"
Valid valuestrue, false
Invalid values"true", 1, 0, "yes"
// Schema
{ "archived": "Boolean" }
// Value
{ "archived": false }

Accepts date strings in two formats. Time-of-day is optional.

PropertyDetail
Schema definition"Date"
Format (date only)YYYY-MM-DD — e.g. "2024-01-15"
Format (datetime)YYYY-MM-DDTHH:MM:SS — e.g. "2024-01-15T10:30:00"
Invalid values"Jan 15 2024", "2024/01/15", 1705276200 (epoch)
// Schema
{ "due_date": "Date" }
// Value
{ "due_date": "2024-06-30" }

A pointer to another thogit, stored as a ULID string. The referenced thogit must exist at validation time.

PropertyDetail
Schema definition"Reference"
Valid valuesA ULID string like "01JQXK6V9XCSV5K9Z1MQSK5RBT"
ValidationULID format check and existence check against thogit lookup context
Invalid values"not-a-ulid", a ULID pointing to a deleted/non-existent thogit
// Schema
{ "parent": "Reference" }
// Value
{ "parent": "01JQXK6V9XCSV5K9Z1MQSK5RBT" }

A single-choice field from a list of named variants. Variants can optionally define sub-fields — additional typed fields that become active when that variant is selected.

PropertyDetail
Schema definition{"type":"Select","variants":["A",{"name":"B","fields":{...}}]}
Value format{"variant":"VariantName"}
Validationvariant must match one of the defined variant names

Each variant in the variants array is an object:

KeyTypeRequiredDescription
namestringYesThe variant identifier
fieldsobjectNoMap of sub-field names to schema types

Sub-field values are stored flat in the parent field_values map alongside the select value itself. They are not nested inside the variant object.

{
"status": {
"type": "Select",
"variants": [
"Open",
{ "name": "InProgress", "fields": { "assignee": "String" } },
{ "name": "Closed", "fields": { "resolution": "String", "closed_at": "Date" } }
]
}
}

A multi-choice field from a list of string variants. Unlike Select, MultiSelect variants are plain strings without sub-fields.

PropertyDetail
Schema definition{"type":"MultiSelect","variants":["Low","Medium","High"]}
Value formatJSON array of strings: ["Low","High"]
ValidationEvery item must be a defined variant name; no duplicates allowed
Empty selection[] is valid
// Schema
{
"labels": {
"type": "MultiSelect",
"variants": ["Bug", "Feature", "Docs", "Urgent", "Breaking"]
}
}
// Value
{ "labels": ["Bug", "Urgent"] }

All fields are nullable by default. There is no required modifier. A field is considered null when:

ConditionValid?
Key is missing from field_valuesYes (treated as null)
Key is present with value nullYes (explicitly null)
Key is present with wrong typeNo — validation error

You can filter for null/non-null fields using the exists and is_null operators. See the Filter Operators reference.


A tag using all 7 field types, and a thogit with values for each.

{
"name": "Project Tracker",
"schema": {
"title": "String",
"story_points": "Number",
"is_epic": "Boolean",
"due_date": "Date",
"parent_project": "Reference",
"status": {
"type": "Select",
"variants": [
"Backlog",
{ "name": "Active", "fields": { "started_at": "Date" } },
{ "name": "Done", "fields": { "completed_at": "Date" } }
]
},
"labels": {
"type": "MultiSelect",
"variants": ["Frontend", "Backend", "Infra", "Design", "Docs"]
}
}
}