# Metadata Schema Formation Resource

> Declares what metadata must satisfy for one resource type under one selector, so a template ships the corpus and the rule governing it together. resource_type…

# Metadata Schema

> This page is auto-generated from the formations OpenAPI spec.
> Do not edit manually — run `pnpm generate-formations-resource-docs` to regenerate.

Declares what `metadata` must satisfy for one resource type under one selector, so a template ships the corpus and the rule governing it together. `resource_type` is immutable: changing it in a template is a delete and a create.

## Syntax

```yaml
type: metadata_schema
properties:
  resource_type: String
  path_prefix: String
  schema: Object
```

## Output

The physical resource ID is the **public ID** of the created resource. Reference it from other resources with a `ref` expression:

```yaml
      some_field:
        ref: MyMetadataSchema
```

## Properties

**`resource_type`**

The resource whose metadata this declaration governs.

_Required_: Yes
_Type_: String
_Allowed values_: `document`

---

**`path_prefix`**

The selector a `document` declaration must carry: the directory it governs, matched on a path boundary.

_Required_: No
_Type_: String

---

**`schema`**

A JSON Schema, stored as written.

_Required_: Yes
_Type_: Object

---
