dref
v1.0.0
specification.json
Open Domain Model & Validation Specification

Declare your domain once. Enforce it everywhere.

DRef is a vendor-neutral specification for domain models, governance, and mapping, adopting Regl for property validation. You define a model — its fields, Regl rules, ownership, and retention — and the same declaration drives validation across every runtime.

45Regl rules
22transforms
4domains
6scopes
20curated models
Reference implementations:Java ✓TypeScript ✓Python · plannedGo · plannedRust · plannedC# · planned

One model, many runtimes

Declare a model once as JSON. The same rules validate input across teams, services, and languages.

Validation by Regl

Field validation normatively adopts the open Regl specification (regl.dev). Atomic declarative rules — email, bounds, regex, uniqueness — are evaluated uniformly across runtimes.

Ownership & lifecycle as concepts

Authority, mutability, retention (TTL), and instance-count bounds are first-class model attributes.

Map foreign models in

Mapping definitions (mapsFrom) live on the model they import into — pure 1:1 field maps with an optional transform chain. Validation stays with the source model document.

A model, in one file

Identity, retention, and every validation rule live on the model itself. Nothing is scattered across validators or ORMs.

{
  "name": "PaymentIntent",
  "authority": "client",
  "properties": [
    {
      "name": "id",
      "type": "String",
      "required": true,
      "key": true,
      "rules": [
        {
          "type": "startsWith",
          "param": "pi_"
        },
        {
          "type": "immutable"
        }
      ]
    },
    {
      "name": "amount",
      "type": "Number",
      "required": true,
      "rules": [
        {
          "type": "positiveInteger"
        }
      ]
    },
    {
      "name": "customerEmail",
      "type": "String",
      "required": false,
      "rules": [
        {
          "type": "email"
        }
      ]
    }
  ]
}