CEDAR now supports YAML metadata
CEDAR has long been able to hand users a template, element, field or an instance as YAML — a clean, human-readable format that is easy to skim, edit by hand, and track in version control. With the 2.9.0 release, that street now runs both ways: CEDAR accepts YAML too. You can author and edit templates, elements, fields, and instances as plain YAML.
Nothing about CEDAR’s underlying model has changed. Templates, elements and field remain in JSON Schema and metadata remains in JSON-LD; YAML is simply another serialization of those artifacts. Every template, element, field or instance round-trips through YAML and back to the identical JSON Schema or JSON-LD, so YAML is a convenience for authoring and review — not a new format to adopt or migrate to.
There is nothing new to learn and no separate endpoint to call. Every artifact route negotiates the representation per request, so JSON and YAML clients work side by side: ask for YAML and you receive YAML, send YAML and CEDAR ingests it.
A small example makes the difference concrete. Here is a real CEDAR template — a study with a single text field — as YAML:
type: template
name: Study
id: https://repo.metadatacenter.org/templates/3b2af8ae
status: draft
version: 0.0.1
children:
- key: Title
type: text-field
name: Title
description: The title of the study
configuration:
required: true
modelVersion: 1.6.0
createdOn: '2024-03-27T13:57:17-07:00'
modifiedOn: '2024-06-14T11:42:47-07:00'
createdBy: https://metadatacenter.org/users/6d21a887
modifiedBy: https://metadatacenter.org/users/6d21a887
That is the whole template. The equivalent CEDAR JSON Schema — the same artifact with its @context, JSON-LD typing, per-field _valueConstraints and _ui blocks, and property definitions spelled out — runs many times longer, and CEDAR still generates and stores all of it. YAML just lets a person read and write the parts that carry meaning.
We also support a compact presentation mode, which omits provenance fields for brevity. Here is the above template in compact form:
type: template
name: Study
id: https://repo.metadatacenter.org/templates/3b2af8ae
children:
- key: Title
type: text-field
name: Title
description: The title of the study
configuration:
required: true
The YAML format is documented in the CEDAR YAML specification, and the full API — including the YAML media types — is browsable in the interactive API reference.
