ADL 32 · Part IV — Generated interfaces

0.5.1 baseline + 0.6 edition note

OpenAPI generation

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 generated schema fidelity, security declarations, and response definitions. 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 32-openapi-generation.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.

32.1 Purpose and scope

The per-domain OpenAPI document describes generated HTTP operations and their schemas. Retrieve it through the domain management route:

GET /api/v1/domains/{name}/openapi.json

The current handler builds the document from the stored DomainModel on request; the offline generator uses the same model-based implementation. ADL 26 owns route identity and site selection, ADL 28 owns API declarations, ADL 31 owns errors, and ADL 33 supplies the broader route inventory.

The inherited OpenAPI chapter (v0.5.0, retired) is the baseline. Delta §10.2 adds the adl-reference format and §3.4 governs site-aware paths. This draft records production revision 3a1655dc. It distinguishes an operation appearing in paths from a complete request/response schema and from an actually callable runtime action.

32.2 Document identity and structure

The generator declares openapi: "3.1.0". info.title is <domain> API, and info.version and info.x-adl-version both hold the domain version. The latter is not the adl: language version, suite version, or server release.

components contains schemas and securitySchemes. There are no shared components.parameters or components.responses registries. Operations inline parameters and response descriptions, while resource schemas use local $ref values. Tags are sorted domain/resource names, plus the media tag.

The document-level security declaration is a bearer scheme:

{
  "security": [{"bearerAuth": []}],
  "components": {
    "securitySchemes": {
      "bearerAuth": {"type": "http", "scheme": "bearer", "bearerFormat": "JWT"}
    }
  }
}

This is the advertised scheme, not evidence that every generated operation requires a token or that its role policy is encoded. Runtime permissions are owned by ADL 21.

Paths include the domain’s effective API prefix. The server URL is a bare origin, not another copy of that prefix. The online generator derives an origin from REST host, port, and certificate configuration, replacing a wildcard bind host with 127.0.0.1. It does not derive an externally deployed reverse-proxy URL or insert a selected site segment into every generated path. Use the configured deployment and ADL 26’s site contract when constructing client URLs.

32.3 Resource schemas

Each resource produces read, input, and list schemas. Their names combine the domain and resource names, capitalizing their initial characters; for the examples these are CatalogEntry, CatalogEntryInput, and CatalogEntryList. Domain enum schemas similarly use names such as CatalogStatus.

The read shape excludes internal, write-only, and password fields. The input shape excludes generated primary keys, auto timestamps, autoincrement fields, and internal fields. It is not a distinct schema per operation or per role. A general readOnly declaration does not justify assuming exclusion unless the current model/generator actually uses that flag. Create and PATCH reuse the same input schema, including its required array, even though runtime PATCH allows partial writes.

Nullable nonrequired properties with a simple type become a union such as ["string", "null"]. This adjustment does not wrap a $ref enum in a nullable union. Required fields are listed on resource schemas; input required fields exclude primary keys. Generated foreign keys for belongsTo/hasOne can be added as UUID strings when not already declared, regardless of the target’s more specific effective-key shape.

The list schema requires only items and count. It also advertises optional totalCount, nextCursor, and hasMore. Their actual presence depends on the query mode; ADL 27 owns that response behavior.

32.4 Type projection

The following describes the current generator, not a replacement for ADL 10’s value semantics. Constraints are added on top where retained by the model.

ADL typesGenerated schema
string, textString
integer, autoincrementInteger, int64
decimalNumber, double
floatNumber, float
moneyDecimal-string pattern, optional precision description
percentageNumber, double, bounds 0–100
booleanBoolean
dateString, date
datetime, timestampString, date-time
timeString, time, time pattern
uuid, email, urlString with uuid, email, or uri format
phoneString with phone format and pattern
slugString with slug pattern
passwordString, password, write-only
tokenWrite-only string
jsonEmpty schema accepting any JSON value
referenceString, adl-reference
array, setArray with projected item type; set adds uniqueness
currency, countryStrings with fixed lengths 3 and 2
language, timezoneStrings with descriptive annotations
colorString with hexadecimal color pattern
bytesInteger byte count
svg, media, icon, font, markdownDescribed strings
blocksArray of objects
componentObject of projected nested fields when present
repeaterArray of projected nested objects when fields exist; otherwise object fallback
geometryObject with GeoJSON type vocabulary and coordinate/geometries properties

In particular, media no longer has the inherited table’s mandatory UUID format, money is not a binary floating-point schema, and unconstrained json is not limited to objects. Some projections remain narrower or broader than runtime behavior: blocks can accept objects, nested constraints can be lost, color validation accepts more forms, and exact decimal response/storage semantics require their own checks. See ADL 10, ADL 30, and ADL 42.

A declared reference is an ADL address-bearing value. Its OpenAPI format is adl-reference for both colocated and remote targets. It is not an OpenAPI $ref to the target resource’s object schema. An enum binding, by contrast, can legitimately use a local schema $ref.

32.5 Constraints, enum metadata, and extensions

The generator emits retained minimum/maximum lengths and values, patterns, defaults, nullable unions, selected security annotations, and deprecation. Array/set counts and uniqueness have explicit handling. The nested object projection uses type schemas rather than the full top-level field-schema builder, so a complete nested validator cannot be reconstructed from it.

ExtensionMeaning
x-adl-versionDomain version in info
x-enum-descriptionsLabels/descriptions associated with enum values
x-enum-colors, x-enum-iconsEnum display metadata
x-kalos-primary-keyPrimary-key property
x-kalos-auto-generatedRuntime-generated value
x-kalos-immutableCreate-only value
x-kalos-owner-fieldField named by the resource ownership declaration
x-kalos-slug-fromSlug source field
x-kalos-read-roles, x-kalos-write-rolesDeclared field-role metadata

These extensions describe declarations; they are not an authorization filter or proof that every consumer understands the policy. An enum can be inline or referenced from a domain enum. No separate enum component is promised for every inline field enum.

Opaque field ui metadata is not included in this generator. Retrieve it from /schema, with the limitations in ADL 34. The include_extensions argument exists on the offline API but is not consulted by the inspected implementation; it is not a reliable extension-removal switch.

32.6 Operations and coverage

For an ordinary resource the current generator emits list/create on the collection; get/PATCH/delete on the item; count and distinct; and POST/PATCH/ DELETE bulk operations. The inherited statement that count/distinct/bulk are absent is stale. Media-library paths are emitted for every domain.

Conditional output includes soft-delete restore, belongsToMany list/link/ unlink, state transitions, and custom operations. Abstract resources contribute component schemas but no paths. A resource API version or collection override changes the generated collection path.

Correction. Two entries in this list described the generator as it stood before 2026-09-13, when the query grammar and PUT were added (openapi_generator.cpp). The chapter’s snapshot predates that change, and the list below is corrected to what the generator emits now. The remaining entries were re-read against the same file and still hold.

The generator now emits PUT on the item path, the /count, /distinct and /bulk paths, and list parameters beyond the basic three: page, search, include, fields, and the filter family filter[<field>] with its [gte]/[gt]/[lte]/[lt] forms. ADL 27 remains the owner of what those parameters mean; this chapter owns only whether they appear in the document.

The following gaps remain at this revision:

  • Domain API aliases, standard-operation method/path overrides, and composite primary-key item paths are not fully represented.
  • hasMany nested lists, audit/history feeds, version/revert, import/export, sheet columns, and most domain subsystem routes are omitted.
  • Several emitted operations have only response descriptions, with no body schema or operationId. Count/distinct/bulk path coverage is not complete parameter or payload coverage.
  • The emitted filter parameters do not cover every operator ADL 27 defines; in, like and ieq are not separately described in the document.
  • Common error response maps omit statuses such as 403 and 409 that runtime operations can return.

A state transition’s generated operationId includes .transition.<name>; its registered action uses the runtime’s transition action name. Other emitted IDs can also use the legacy bus spelling. Do not treat an OpenAPI operationId as a callable canonical bus address without comparing the registry.

Custom operation generation replaces :id in the path and advertises an id parameter even for a collection custom path. An emitted document can therefore require review for client-generator compatibility. This batch does not certify Swagger UI, Redoc, or a third-party code generator.

32.7 Schema introspection is a separate interface

The domain /schema handler primarily returns a resolved-source view enriched with collection and table metadata. OpenAPI instead projects a DomainModel into API types and operations. They differ in metadata, defaults, permission presentation, and preservation of ignored source keys. Neither is a byte-exact copy of authored YAML.

The examples invoke both native actions after submitting the same domain, compare field roles and ui, and compare the registered route method/path pairs with generated OpenAPI operations. The comparison retains both missing and extra operations. Merely checking that a path appears would miss the PUT omission; the existing two OpenAPI conformance tests use a narrower path-level oracle and are described accordingly in the evidence.

32.8 Verification and use

The coverage catalog gives actual pairwise results for ordinary, overridden, aliased, disabled, versioned, abstract, custom, and composite-key examples. The full generated documents are retained in the verification record, together with source and adapter hashes.

Use the document as a generated description of the covered surface, review its differences against the running route registry, and consult ADL 33 for omitted operation families. No passing parser result or path-count check proves complete API parity. The evidence separates native generation, registered routes, invoked actions, and source-only claims.