ADL 0.6.0 reference · Review draft 1 · November 14, 2026.
Contents · Source map · Evidence
The 0.6 edition note
This chapter retains the detailed language contract and its source-specific observations. Its chapter number and numbered sections remain stable. The 0.6 additions do not by themselves change this subject’s defaults or supply fresh execution evidence for it.
Reverification should cover field type coercion, exact numeric boundaries, and SQLite/PostgreSQL differences. Use the original examples and evidence links below to recover the earlier test context. The new edition’s source map records this chapter as inherited detail; the current draft does not claim those historical tests were rerun.
Retained reference detail
The numbered sections below are carried from 10-type-system.md. Their original baseline and evidence remain attached to the source. Statements about “current” or “checked” behavior in this retained text refer to those original observations unless the edition note explicitly updates them. This is a consolidated draft, not a claim of complete re-verification.
10.1 Scope and authority
A field type specifies the values a client can send, the values it receives,
and the constraints a host enforces. Storage choices may differ between
adapters; the declared API guarantee must survive those choices. A parser
accepting type: decimal does not establish exact decimal writes or reads.
The inherited contract is reduced v0.3.1 Chapter 7 (retired).
Draft 05 §18 item 26 retires
alternative and nonexistent type spellings; §10.2 adds reference and its
stable wire representation. The older chapter’s alias permission is therefore
superseded. Its error record (v0.3.1, retired)
also identifies an omitted enumRef entry and an unverified blanket claim
about ignoring client-supplied generated values.
The edition inventory is 39 canonical type spellings: the inherited 38
plus reference. All 39 occur in the reviewed production parser’s table and
pass the chapter’s explicit field-declaration checks. The delta’s parenthetical
“37 spellings” and several implementation comments are stale counts; they are
not grounds for deleting an existing type. Group names below are reading aids.
They assign no capability tier or storage requirement.
ADL 11 owns enumerations; ADL 12 owns relationships and reference binding; ADL 13 owns shared objects and composition; ADL 20 owns validation ordering and cross-field rules; ADL 21 owns permissions; and ADL 32 owns the complete generated OpenAPI contract.
10.2 Field declarations and accepted vocabulary
Declare resource fields beneath domain.resources.<Resource>.object. Use a
mapping with an explicit, canonical lowercase type; the remaining keys
describe constraints, generation, or metadata. This fragment declares two
fields, not a complete domain:
code: { type: string, required: true, maxLength: 24 }
unitPrice: { type: decimal, precision: 19, scale: 4, default: "0.0000" }
type is a type name, precision and scale are integer declarations,
required is a boolean, and the decimal default is text. A resource name, enum
name, shared-object name, or plugin name is not an additional primitive type.
Use the owning declaration mechanism to reference such definitions.
The vocabulary is closed. An unknown type is an authoring error, and the
retired spellings in §10.11 are rejection
cases. enum is a constraint/declaration construct, not a field type. vector
is deferred; the informative ADL 43 pattern
does not add it to the vocabulary.
Observed parser limits. The checked parser accepts INTEGER and binds it
to integer. Missing type and a non-string type: 123 silently bind to
string. Scalar shorthand value: integer also works, but value: int
silently binds to string, bypassing the explicit mapping’s rejection. These
fallbacks do not make malformed declarations portable. Complete examples in
this chapter use explicit mappings.
10.3 Complete type inventory
The JSON column describes the inherited language contract, with the
v0.5.1 reference amendment. It is not a transcription of generated schemas.
The last column points out checked disagreements or the limit of the evidence;
an empty disagreement is not a claim that all values or operations were tested.
| Type | Group | Contract JSON and meaning | Checked boundary |
|---|---|---|---|
string | Core | String; short text, default maxLength: 255 | Implicit 255 limit absent; §10.4 |
text | Core | String; long text, no default length limit | Representative string accepted |
integer | Core | Number; signed 64-bit whole value | Past-int64 input refused too_large; §10.4 |
decimal | Core | String; exact decimal | Numeric schema/output and precision loss; §10.4 |
boolean | Core | Boolean; inherited input also permits 1/0 | Numeric 1 rejected by field validator |
date | Core | String; calendar date | Regex accepts an impossible date |
datetime | Core | String; timestamp with timezone | Regex accepts impossible components |
uuid | Core | String; inherited UUID v4 identity | Validator accepts another UUID version; generation is separate |
email | Core | String; inherited RFC 5322 address requirement | Representative address accepted; full RFC coverage untested |
url | Core | String; absolute URL with scheme | Validator restricts to HTTP(S) |
float | Extended | Number; binary floating point | Numeric output; unsuitable for an exact money contract |
timestamp | Extended | Number; Unix epoch seconds | Numeric input, string output, date-time schema disagree |
slug | Extended | String; URL-safe text, generation through from | Generation qualifications in §10.7 |
json | Extended | Object; arbitrary untyped contents | Validator also accepts scalars and JSON text |
markdown | Extended | String; raw Markdown | No rendering contract |
autoincrement | Extended | Number; server-assigned, read-only, never reused | Supplied ID ignored in tested create; non-reuse untested |
phone | Specialized | String; author pattern, no inherited E.164 assumption | Built-in phone pattern narrows accepted values |
time | Specialized | String; time of day | Representative time accepted; full format coverage untested |
password | Specialized | String in; absent out; hashed on write | Response omission works; tested storage is plaintext |
token | Specialized | String; generated, read-only after create | Schema says write-only; row helper returns supplied stored token |
array | Specialized | Array; typed list | Item validation coverage varies; §10.5 |
money | Domain | String; exact value, implicit precision 19/scale 4 | SQLite round trip loses digits |
percentage | Domain | Number; percentage | Checked validator/schema impose 0–100 |
currency | Domain | String; inherited ISO 4217, three uppercase letters | Shape validation does not establish code membership |
country | Domain | String; inherited ISO 3166-1 alpha-2 | Shape validation, not a verified code registry |
language | Domain | String; inherited ISO 639-1, two lowercase letters | Validator rejects en-US; schema describes BCP 47 |
timezone | Domain | String; inherited IANA identifier | Shape validation accepts Nowhere/Imaginary |
color | Domain | String; inherited #RRGGBB | Schema keeps that shape; validator source accepts wider CSS forms |
bytes | Domain | String; inherited base64 and maxSize | Runtime instead treats it as a numeric byte count |
set | Domain | Array; uniqueness always required | Duplicate string values rejected |
media | Content | Object; file reference | Validator/schema expect a string reference |
svg | Content | String; sanitized on write | Sanitization was not exercised |
blocks | Content | Array; block document | Validator also accepts an arbitrary object |
icon | Content | String; set:name, constrained by iconSets | Representative value accepted |
font | Content | String; family, origins constrained by sources | Representative value accepted |
component | Content | Object; one nested object | Nested declaration loses constraints beyond its small parsed subset |
repeater | Content | Array; ordered nested objects | Bare declaration generates object schema; §10.5 |
geometry | Spatial | Object; GeoJSON geometry | Representative point accepted; spatial operations untested |
reference | Reference | String; canonical address:uuid | Scalar shape validation does not prove target binding |
The generated catalog retains all
39 declaration results, schemas, dialect type names, sample validation results,
and row-helper output. Its sample media:example is deliberately an observed
value rejection (invalid_ref), despite successful declaration parsing.
10.4 Scalar constraints and exact numeric values
Text constraints include minLength, maxLength, pattern, trim,
lowercase, uppercase, and enum. Numeric constraints include min and
max; decimal additionally uses precision and scale. The inherited
contract also allows ISO-form min/max bounds for dates and times. Parsing a
constraint without enforcing it is a host defect under the inherited contract.
Exact values need attention at every boundary: document ingestion, default binding, request validation, storage, and response serialization. Quote decimal defaults in YAML and send decimal/money request values as JSON strings. ADL 9 documents the separate loss that can occur before canonical hashing. Quoting the input avoids that ingestion loss; it does not repair the checked runtime’s storage or output conversions.
In the disposable SQLite sequence, fields declared with precision 19 and scale 4 produced these generated-action results:
| Field | Submitted JSON value | Stored row text | Returned JSON value |
|---|---|---|---|
amount: decimal | "0.10000000000000001" | 0.1 | 0.1 — number |
price: money | "12345678901234.5678" | 12345678901234.6 | "12345678901234.6" — string |
epoch: timestamp | 100 | 100 | "100" — string |
byteCount: bytes | 12 | 12 | "12" — string |
flag: boolean | true | true | true — boolean |
The decimal payload deliberately exceeds the declared scale. Accepting and
rounding it is evidence of missing scale enforcement, not a valid precision-19,
scale-4 example. The money payload fits 19 total digits and four fractional
digits, yet still loses precision. Create, get, and a label-only update retain
these observations. The tested SQL dialect maps both types to SQLite REAL.
The PostgreSQL helper reports NUMERIC and NUMERIC(19,4) respectively; no
PostgreSQL database was exercised, and those type names alone prove no API
guarantee.
integer is a signed 64-bit value on every store (#1410). PostgreSQL
stores it, and autoincrement, as BIGINT, whatever min/max declare;
SQLite’s INTEGER is already 64-bit. A JSON whole number above
9223372036854775807 is refused with too_large (422) before it reaches the
database. Before the fix PostgreSQL used a 32-bit INTEGER, so a value such as
a 3000000000 image seed failed with a 500, and SQLite stored 2^64−1 as a
mangled float. Repro 37
shows both.
A PostgreSQL table created before this change keeps its 32-bit columns: the migration planner does not widen a column it did not create. Widen one by hand when its values need the room:
ALTER TABLE <table> ALTER COLUMN "<field>" TYPE BIGINT;
Other direct validator observations establish narrower limits:
| Input/declaration | Observed result and implication |
|---|---|
Decimal "12.3456", precision 5/scale 2 | Accepted; those declarations do not enforce digit counts here |
Decimal or money "NaN" | Accepted through numeric parsing; text input is not an exact finite-decimal validator |
Money JSON number 100000000000000 | Rejected with precision_loss; this guard does not make other numeric inputs exact |
String of 256 characters, no maxLength | Accepted; the inherited default of 255 is not installed |
"é", maxLength: 1 | Rejected with too_long; checked length is UTF-8 bytes |
2026-02-31 date | Accepted; calendar validity is not established by the regex |
2026-99-99T99:99:99Z datetime | Accepted; component ranges are not fully checked |
Timestamp 1.5 | Accepted; the current validator does not require an integer |
ftp://example.test/file URL | Rejected with invalid_url; broader absolute-URL contract is not implemented |
(202) 555-0123 phone | Rejected with invalid_phone; built-in pattern applies without an authored one |
SGVsbG8= bytes | Rejected with invalid_type; inherited base64 contract is not implemented here |
The reviewed parser only binds numeric min/max values, so ISO-string bounds
are not represented by that path. External-standard names in the inventory
identify inherited ADL requirements; these checks do not independently validate
the current contents of an ISO/IANA registry or full RFC grammar.
10.5 Arrays, sets, and nested objects
Use array with items: { type: string } for a typed sequence. minItems
and maxItems bound its length; uniqueItems: true disallows duplicates.
set uses an array representation with uniqueness always enforced. The name
does not authorize arbitrary reordering of the array or its canonical bytes.
Use component with object: for one nested object and repeater with
object: for an ordered sequence of them. A shared-object $ref may supply
that object definition through ADL 13. A nested value has
no independent record identity or relationship target. The inherited contract
stores and returns it whole and does not give its members independent filtering
or query endpoints. Use a resource and relationship when that API is required.
The complete example in §10.10 includes all three shapes. Observed limits:
setrejects duplicate strings, and a required nested member rejects when absent. These paths were exercised directly.- The reviewed nested parser retains name, type, and
required, but does not carry the full field constraint model. A nestedminLength: 5accepts"x"and is absent from the generated schema. Deeper constraint guarantees are therefore not established by accepting the enclosing component. items.type: intescapes declaration rejection and binds tostring; a numeric array item then failsinvalid_item_type. Explicit nestedobjectfields usingtype: intdo reject at declaration time.items.type: referencewith numeric item7passes this validator. The item model is not equivalent to a complete reference-field declaration.- A bare
type: repeaterproduces an object schema in the checked generator, while the supplied array value is accepted. The complete example’s repeater has anobject:definition and produces an array schema. Schema shape must be checked with the actual declaration.
These differences are recorded defects or coverage limits, not permission to replace nested constraints with documentation hints.
10.6 Presence, null, defaults, and field constraints
Omission and explicit null are distinct inputs. A default applies when the
field is omitted on create. A partial update omitting a field leaves its value
unchanged; it does not ask to clear the value or rerun a create default.
| Key | Inherited contract/default | Verification boundary |
|---|---|---|
required | Present and non-null on create; false by default | Missing/null rejected by direct validator when no default exists |
notBlank | Not null, "" or whitespace-only; false by default (#1537) | Refused with 422, detail code blank on the field; checked after trim, lowercase and uppercase |
nullable | Explicit null allowed; true unless required | Direct helper misses an explicit false flag; actual update rejects null |
default | Supplies an omitted create value | Bound scalar defaults recorded; not every default shape is implemented |
unique | No other record shares the value; false by default | Requires stored-data checks; not proved by scalar validation |
immutable | Changing the value after create is rejected with 422; false by default | General immutable-field write combinations not exercised here |
primaryKey | Record identity | UUID/autoincrement create behavior checked separately in §10.7 |
The direct helper accepts null for nullable: false when the field is not
required. It also accepts null for a required field with default ready.
Neither observation establishes that the full write succeeds. In the generated
action sequence, an explicit null update to a non-nullable field returns
422 REQUIRED_FIELD, and the following get retains the old value. A
label-only update also succeeds without resupplying the other fields.
Current model binding stores scalar defaults as text: booleans become 1/0,
numbers are converted to text, and strings retain their contents. Null and
structured defaults are not carried by this path. An array default ["x"]
becomes an empty default field in the model. An empty-string default is also
indistinguishable there from no default, and does not satisfy the direct
helper’s required-field check. Authors and schema reviewers must not infer a
working default solely from its presence in the source document.
required is presence only: it accepts "" and " ". notBlank: true is
the stricter check most human-entered names, titles and bodies want, matching
Rails presence: true and Django blank=False (#1537). A create that omits the
field, or sends null, "" or only whitespace, is refused with 422
VALIDATION_ERROR whose detail names the field with code blank; a default
that fills an omitted field satisfies it. A partial update that omits the field
leaves it alone, and one that sends a blank value is refused. Because it runs
after the string transforms (§10.4), trim: true makes no difference to which
values it refuses. A custom message goes under messages: {notBlank: ...}.
enum and enumRef constrain the values of an existing field type. The
inherited summary omitted enumRef; it is included here by reference to
ADL 11. Domain enum values: uses the mapping form under
Draft 05 §18 item 25. This chapter does not reproduce or amend all enum binding
forms, nor does it introduce type: enum.
10.7 Identity and server-assigned values
Generation is a field behavior layered on a type. An ordinary UUID field is not automatically a primary key, and a UUID’s lexical validity does not prove that a referenced row exists. ADL 7 §7.5 owns UUIDs inside reference literals.
| Declaration | Inherited assignment | Checked behavior or limit |
|---|---|---|
UUID with primaryKey: true | Generated identity unless allowUserProvided: true | Omitted ID generated; supplied ID rejected with 400 PK_REJECTED |
autoincrement primary key | Next server integer; read-only, never reused | Supplied 900 ignored; fresh temporary table returns 1 |
autoNow: create | Current time on create, retained thereafter | Supplied year-2000 value overwritten; label update retains generated time |
autoNow: always | Current time on create and update | Source-supported mechanism; not exercised in this sequence |
slug with from: | Derived slug; inherited regeneration and collision suffix rules | Source accepts an explicit nonempty slug on create; regeneration/collision guarantees not rechecked |
token | Random value on create, read-only afterward | Generation and immutability not exercised |
The legacy sentence saying every submitted generated value is “ignored, not rejected” cannot describe the observed UUID behavior. Its own error record already marked it unverified. This draft preserves the discrepancy for amendment review and reports operation-specific outcomes. It does not invent a universal policy for all generated fields.
Likewise, successful creation in a fresh autoincrement table proves neither
non-reuse after deletion nor behavior after import, rollback, or migration.
The parser’s additional autoNow: update handling is implementation evidence;
it is not added to the inherited generation table as an edition amendment.
10.8 Reference fields
The v0.5.1 declaration pairs type: reference with a resource address in
references:. This is a fragment from the complete
reference example:
customer:
type: reference
references: "adl.core.party.Person"
The corresponding non-null value has the form
adl.core.party.Person:11111111-1111-4111-8111-111111111111.
references: identifies a declaration; the value identifies a row. Neither
uses a physical table name, and a UUID field is not a substitute for a reference
field carrying the complete address string.
Draft 05 §10.2 requires the same logical and wire representation for co-located
and remote targets. A host may use UUID storage plus binding metadata locally,
but clients still send and receive address:uuid. Binding selection must be
recorded in the resolved artifact. A change of physical binding is a migration
that preserves the logical value and rejects untranslatable values before
applying. ADL 12 owns integrity, binding, and authority;
ADL 8
owns reuse and dependency loading.
The strict parser rejects a missing references:, a non-resource address
adl.core.party, and references: attached to type: uuid. Its field validator
accepts a syntactically shaped reference whose address names a different target
from the field declaration. That scalar check proves neither target agreement,
existence, import authorization, version-pin selection, nor remote access.
This chapter performs no reference write or remote dereference.
10.9 Visibility, passwords, and content boundaries
The inherited visibility declarations may appear on the field or inside
security:. internal prevents client serialization under every projection;
hidden omits the field by default; requestable permits explicitly requesting
a hidden field and defaults to false. mask is an advisory display hint: it
does not itself remove the value from storage or responses. Endpoint access
and field authorization remain ADL 21 concerns.
password has the stronger type contract: it must never appear in a response,
including an explicit fields request, and must be hashed on write. The
checked create, get, requested-fields get, update, and subsequent get all omit
the password. The generated read schema also excludes it.
Storage finding: the same disposable sequence stores the synthetic value
chapter-only-password verbatim. Response omission therefore works at the
tested surfaces while the inherited hashing-on-write guarantee fails on that
generated-action path. No authentication plugin or separate account-management
path was tested. No runtime hashing fix is included in this documentation.
For token, the field schema carries writeOnly, but the generic response
filter returns the synthetic stored token. Its schema flag is not evidence of
runtime omission. This is separate from the inherited token contract, which
permits a string response and requires generation and write restrictions.
Content semantics need their owning checks. ADL 30 owns content types; ADL 41 owns file references; ADL 42 owns spatial declarations; and ADL 45 owns privacy declarations. Acceptance of sample SVG, blocks, media, or geometry is not proof of sanitization, file access controls, valid spatial operations, or rendering.
10.10 Complete example and observable outputs
This complete inventory.yaml uses baseline
constructs and declares adl: "0.5.0". The edition’s newer constructs use the
separate adl: "0.5.1" reference fixture. Language version is distinct from
the domain’s version, as specified in ADL 6.
adl: "0.5.0"
domain:
name: inventory
version: "1.0.0"
resources:
Item:
object:
id: { type: uuid, primaryKey: true }
code: { type: string, required: true, maxLength: 24 }
available: { type: boolean, default: true }
quantity: { type: integer, min: 0 }
unitPrice: { type: decimal, precision: 19, scale: 4, default: "0.0000" }
insuredValue: { type: money, precision: 19, scale: 4 }
labels:
type: set
items: { type: string }
maxItems: 8
dimensions:
type: component
object:
description: { type: string, required: true }
length: { type: decimal }
lines:
type: repeater
minItems: 1
object:
sku: { type: string, required: true }
quantity: { type: integer, required: true }
The strict production adapter, production CLI, and adl-ref accept this document; the CLI and modeller report no warnings. That demonstrates declaration coverage, not complete enforcement of the numeric or nested constraints.
wire.yaml supplies the separate, disposable
generated-action fixture. It installs a Record resource with explicit admin
permissions. The adapter supplies a synthetic admin identity and invokes
generated actions through the core request dispatcher; it does not send HTTP
requests or test authentication. It records create/read/update responses and
raw stored rows. The actual response values are in §10.4 and the
JSON verification record.
The generated schema has its own evidence boundary. Decimal is described as a number/double, money as a string, timestamp as a date-time string, bytes as an integer, and media as a string. Those outputs conflict with parts of the inherited contract and, for timestamp/bytes, with actual response value shapes. A schema generator and a row serializer agreeing on one type does not establish agreement for the remaining inventory.
10.11 Diagnostics and migration
Replace these spellings before submitting an explicit field declaration. The table includes the twelve retired aliases and the three names that the delta classifies as never having been types. Where a replacement requires a modeling choice, do not perform an unqualified text substitution.
| Rejected spelling | Canonical replacement or decision |
|---|---|
int | integer |
bigint | integer; already signed 64-bit on every store |
bool | boolean |
number | Choose integer, float, or decimal for the value contract |
id | Choose uuid or autoincrement and declare identity explicitly |
object | Choose untyped json or a typed object through composition |
double | float |
md | markdown |
auto_increment | autoincrement |
percent | percentage |
colour | color |
lang | language |
tz | timezone |
filesize | bytes; review the documented base64/byte-count contract conflict |
geojson | geometry |
All fifteen explicit mapping forms reject in the strict adapter with a
did-you-mean diagnostic. vector, enum, and misspelled decmial also reject.
The checked non-strict path accepts bool, warns, and binds it to string.
That degradation is not alias resolution to boolean and does not prove that
an authoring interface enforces strict admission.
The complete reject-alias.yaml exposes
an entry-point disagreement: the strict adapter rejects int, while the
production CLI exits 0 with warning W001. adl-ref exits 1 with UNKNOWN_TYPE.
The reference example is accepted by the production paths but adl-ref reports
UNKNOWN_TYPE and an unknown references key. That latter result is a modeller
coverage limit, not evidence that v0.5.1 forbids reference fields.
Field-validator errors such as required, invalid_type, too_long, and
duplicate_items are per-field results at a helper boundary. They are distinct
from generated-action response codes such as PK_REJECTED and
REQUIRED_FIELD. ADL 31 owns the client error envelope;
this chapter does not assign HTTP status to every parser/helper diagnostic.
10.12 Verification and remaining review
The evidence record preserves 109 adapter cases, including all 39 canonical declarations, all fifteen retired/never-type spellings, boundary inputs, and three SQLite action sequences; six CLI/modeller commands; and 64 passing existing Release tests. The example instructions explain reproduction.
Reviewed source and archived adapter headers use 2cae30f6. Existing compiled
libraries, test executables, and CLI are identified by separate hashes; a fresh
production build of that revision is not claimed. The
source register records the
21 reviewed files while the shared checkout continues to change.
Publication review must resolve the stale count, inherited wire-contract conflicts, exact-value enforcement, nested/default handling, password hashing, and server-assigned-value policy. Schema and implementation defects need their own fixes and verification. General immutable/unique enforcement, slug collision handling, token generation, SVG sanitization, all reference-binding modes, PostgreSQL execution, and live HTTP remain outside this chapter’s executed evidence. Draft 1 is a reviewed account of the requirements and these limits, not a certification of the whole host.