Skip to main content

Deprecate types and mark draft version roots

Types in the type registry now have a lifecycle. A type can be deprecated with a sunset date, a message and a replacement, and a namespace says whether its version root is stable or still a draft. Both are on the Primitives and Type registry REST APIs.

  • Deprecate a type. POST /v1/primitives/{tenant}/{id}/deprecate marks a type as one to stop using. The body is optional: sunset_date (YYYY-MM-DD, today or later), message and replacement_id. Calling it again changes those details.
  • It is a marker, not a lock. A deprecated type still resolves and validates, its bindings are unchanged and its JSON Schema is not modified. Nothing breaks on the sunset date.
  • Restore it. DELETE /v1/primitives/{tenant}/{id}/deprecate clears the deprecation.
  • Read it anywhere. Every type carries deprecated, deprecated_at, sunset_date, deprecation_message and replacement_id; a single type also returns replacement with the replacement's name and $id.
  • Draft version roots. A namespace has a root_status of stable (the default) or draft. Create the next version's namespace as a draft, then set it to stable when it is ready. GET /v1/types/{tenant}/namespaces?root_status=draft lists draft roots apart from stable ones.
  • Audited. Deprecating and restoring are recorded as primitive.deprecate and primitive.restore in the registry audit log.

Core system types cannot be deprecated, and system namespaces are always stable.

In the app, Deprecate and Restore are on a type's page and Root status is on the Namespaces & scopes tab — see Deprecate a type and Version roots.