vectordotdev/vector · error

Documentation model has no components

Error message

Documentation model has no components

What it means

Data-shape guard in validation_cases: the loaded docs model JSON is expected to contain a 'components' object mapping component kinds to components, and this fires when that key is missing or not an object — indicating the generated documentation model is empty, truncated, or the wrong file entirely, not a problem with any example.

Solutions

  1. Regenerate the docs model (make generate-docs) before running component example validation
  2. Verify the JSON file passed to the check is the generated documentation model and not an unrelated file
  3. Inspect the JSON root keys to confirm 'components' exists
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at vdev/src/commands/check/component_examples.rs:119 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/df156039f2f579e3. Report an issue: GitHub.

Appendix: source

Thrown at vdev/src/commands/check/component_examples.rs:119

    );
    if failures.is_empty() {
        println!("All examples passed.");
        return Ok(());
    }
    for failure in &failures {
        println!("{failure}");
    }
    bail!("{} validation failure(s).", failures.len())
}

fn validation_cases(
    examples_dir: &Path,
    docs: &Value,
) -> Result<(Vec<ValidationCase>, usize, usize)> {
    let components = docs
        .get("components")
        .and_then(Value::as_object)
        .ok_or_else(|| anyhow!("Documentation model has no components"))?;
    let mut cases = Vec::new();
    let mut total = 0;
    let mut skipped = 0;

    for (kind, components_of_kind) in components {
        let components_of_kind = components_of_kind
            .as_object()
            .ok_or_else(|| anyhow!("Component kind {kind} is not an object"))?;
        for (component_type, component) in components_of_kind {
            for variant in ["minimal", "advanced"] {
                total += 1;
                let key = format!("{kind}/{component_type} ({variant})");
                let path = examples_dir
                    .join(kind)
                    .join(component_type)
                    .join(format!("{variant}.yaml"));
                let yaml = fs::read_to_string(&path)
                    .with_context(|| format!("Could not read {}", path.display()))?;

View on GitHub (pinned to bdb87aeaa4)