Check type ID#

kind: object_field_type

Purpose#

Require that a frontmatter field has a specific type.

Configuration keys#

FieldRequiredDefaultMeaning
fieldyes-Frontmatter key to check.
typeyes-One of string, boolean, array, object, number, integer.

Example#

collections:
  notes:
    path: notes
    checks:
      - kind: object_field_type
        field: year
        type: integer

Worked example#

Here year is a string, not an integer. An inline object_field_type check fails the item, points at the offending field with a JSON pointer (/year) and a path:line prefix, and exits 1.

Input#

notes/dune.md

---
title: Dune
year: "not a number"
---
# Dune

.katalyst/storage/my_directory.yaml

type: filesystem
root: .
collections:
  notes:
    path: notes
    checks:
      - kind: object_field_type
        field: year
        type: integer

Command#

$ katalyst check notes/dune
<project>/notes/dune.md:3: /year: field "year" must be type "integer"
exit status 1