Skip to content

hf_hub validate_readme reports a card with unparseable front matter as valid #5232

Open

Description

@noahgift

DatasetCardValidator::validate_readme (crates/aprender-data/src/hf_hub/validation.rs) returns an empty error list whenever the README front matter fails to parse as YAML:

let Ok(yaml) = serde_saphyr::from_str_with_options::<serde_json::Value>(...) else {
    return errors;
};

A card with broken YAML front matter therefore validates as clean, and validate_readme_strict returns Ok(()). The skip predates the YAML-reader swap (#5205): on main, under serde_yaml, the code was the same.

Expected: an unparseable front matter is reported, either as a ValidationError on a frontmatter field or as an Err from validate_readme_strict, never as a pass.

RED row to add with the fix: a README whose front matter is task_categories: [unclosed must produce at least one error.

Refs #5205

Activity

  1. added this to the 0.71.1 milestone on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions