Skip to content

V002 diagnostics name internal field doc_type, but the authored front-matter key is type #1

Description

@worldMachine

Both V002 diagnostic messages refer to a front-matter field called doc_type:

  • src/validate.rs:79 — "Missing front matter: no doc_type specified"
  • src/validate.rs:98 — "Missing front matter field: doc_type"

But doc_type is only the internal Rust field name. The authored key is type: via the serde rename at src/types.rs:27 (#[serde(rename = "type", ...)] pub doc_type).

A user who follows the diagnostic literally and adds doc_type: plan to their front matter gets no relief — the key the validator actually reads is type:. The messages should say type (optionally with a parenthetical noting it selects the document type).

Related context while reading this path: V002 is intentionally suppressed whenever P002/P005 fire (src/lint.rs:1421-1426), so V002 and P005 can never co-fire on one document — that behavior looks correct; only the wording is wrong.

Anchors verified at 6826134 (0.17.2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions