# `LiveVueContract.Schema`
[🔗](https://github.com/Egorrko/live_vue_contract/blob/v0.3.1/lib/live_vue_contract/schema.ex#L1)

Reads the generated contract file (JSON-Schema subset per Vue component) and
validates encoded props against it.

The file is produced from `defineProps<T>()` by `priv/gen.mjs`; nothing in it is
written by hand. Keys are paths relative to a `vue_root` without extension
(`"initiatives/InitiativeList"`, `"prototypes/players/index"`); `fetch/1` resolves a
`v-component` name the way LiveVue's `findComponent` does — by path suffix, `index`
ignored — so `"InitiativeList"` and `"prototypes/players"` both work.

# `all`

All schemas keyed by component name; `%{}` when the file is absent.

# `check_keys`

Compares attribute names with the schema. Returns `[]` or a list of problems.
`shared` are props injected by `LiveVue.SharedPropsView` (always present on the wire).

# `defs`

Named types the schemas refer to with `{"$ref": name}`.

# `fetch`

Schema for a `v-component` name: `{:ok, schema}`, `:error`, or `{:ambiguous, keys}`.
Matches by path suffix with `index` segments ignored, exactly like `findComponent` in LiveVue's JS.

# `path`

Path of the contract file, relative to the host app's cwd.

# `prop_keys`

Attribute names of a `<.vue>` tag that LiveVue would send as props.

# `shortcut_names`

Shortcut tag names (`<.ComponentName>`): file basenames, like `LiveVue.Components`.

# `validate`

Validates an encoded (JSON-ready) props map.

Returns `[]` or `[{severity, path, message}]`. A key the TS type does not declare is
`:warn` (TypeScript is structural; the client just never reads it), everything else is `:error`.
`defs` resolves `{"$ref": name}`; by default, the named types of the contract file.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
