Skip to content

Duplicate schema definitions cause YAML validation issues #14122

Closed

Description

@cwickham

While working on #14093 I found a few places where we have more than one schema for an option. In practice, this means we can end up with validation failures when someone specifies the "losing" schema at the top-level of the document options.

I found four options with this problem. In two cases, the more permissive schema wins or the schemas are the same, so these aren't currently causing any issues. In two cases, there are situations where I can generate YAML validation errors with options that should be OK.

1. logo — Conflict

Defined in: document-options.yml (beamer), document-dashboard.yml, document-reveal-content.yml, document-typst.yml.

Typst's logo-light-dark-specifier-path-optional schema wins at top level. Unlike dashboard/revealjs's logo-light-dark-specifier, it doesn't accept false.

Fails:

---
title: Test
logo: false
format: dashboard
---

ERROR: Field "logo" has value false, which must instead be a string

2. subject — Conflict

Defined in: document-metadata.yml (pdf/office/odt), document-epub.yml

Metadata's string schema wins at top level. Epub's anyOf: [string, object] is not used.

Fails:

---
title: Test
subject:
  text: "Science"
  authority: "BISAC"
  term: "SCI000000"
format: epub
---

ERROR: Field "subject" has value ... The value must instead be a string.

3. copyright — No conflict

Defined in: document-attributes.yml (jats), document-metadata.yml (html-doc/jats)

The more permissive anyOf: [object, string] schema wins. No validation failures.

4. footer — No conflict

Defined in: document-includes.yml (man), document-reveal-content.yml (revealjs)

Both are string. No validation failures.

Activity

  1. added
    bug
    on Feb 26, 2026
  2. added
    yaml-validation
    on Feb 27, 2026
  3. self-assigned this
    on Feb 27, 2026
  4. added this to the Future milestone on Feb 27, 2026
  5. added 2 commits that reference this issue on Mar 5, 2026
    03e6fe5
    783843c
  6. added a commit that references this issue on Mar 5, 2026
    07990f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugyaml-validation

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions