vectordotdev/vector · error

Encountered schema with subschema validation that wasn't…

Error message

Encountered schema with subschema validation that wasn't one of the supported types: allOf, oneOf, anyOf.

What it means

The schema query parser (`schema_type` in lib/vector-config/src/schema/parser/query.rs) classifies a schema node by inspecting `subschemas`. If a subschema validation keyword is present but it is none of `all_of`, `one_of`, or `any_of` (e.g. `not`, `if`/`then`/`else` from a JSON Schema input), the parser does not know how to represent it and panics. This guards a parser invariant: only the three supported combinators are expected in schemas processed by this query API.

Solutions

  1. Rewrite the schema to use only allOf/oneOf/anyOf combinators (e.g. replace `not` with an equivalent enumeration of allowed values)
  2. Strip unsupported subschema keywords before passing the schema to the query parser
  3. Upgrade/patch the schema parser to handle the additional keyword if you control the tooling

Example fix

// before
{ "not": { "enum": ["a"] } }
// after
{ "anyOf": [ { "type": "string", "not-enum-placeholder": true } ] }
// or express allowed values directly:
{ "enum": ["b", "c"] }
Defensive patterns

Strategy: type-guard

Validate before calling

// Before querying, verify only supported combinators are present:
fn has_only_supported_subschemas(schema: &serde_json::Value) -> bool {
    schema.get("subschemas").map_or(true, |s| {
        ["allOf", "oneOf", "anyOf"].iter().all(|k| s.get(k).is_none() || s.get(k).is_some())
            && !s.as_object().map_or(false, |o| {
                o.keys().any(|k| !matches!(k.as_str(), "allOf" | "oneOf" | "anyOf"))
            })
    })
}

Type guard

fn is_supported_combinator(key: &str) -> bool {
    matches!(key, "allOf" | "oneOf" | "anyOf")
}

Prevention

When it happens

Trigger: Calling the schema query/lookup APIs on a parsed schema whose `subschemas` field contains an unsupported combinator keyword (anything other than allOf/oneOf/anyOf, e.g. `not`), causing the `else` branch panic at lib/vector-config/src/schema/parser/query.rs:285.

Common situations: Feeding externally authored JSON Schema documents (with `not`/`if`/`then`) into Vector's schema query tooling; a schema-producing library emitting newer JSON Schema keywords; hand-edited generated schema files loaded by the docs/query tooling.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at lib/vector-config/src/schema/parser/query.rs:285

        // with other schema types i.e. `allOf` in conjunction with specifying a `type`.
        //
        // Right now, the configuration schema codegen should not actually be emitting anything like
        // this, so our logic below is written against what we generate, not against what is
        // technically possible. This _may_ need to change in the future if we end up using any "X
        // of" schema composition mechanisms for richer validation (i.e. sticking special validation
        // logic in various subschemas under `allOf`, while defining the main data schema via
        // `type`, etc.)
        if let Some(subschemas) = self.subschemas.as_ref() {
            // Of all the possible "subschema" validation mechanism, we only support `allOf` and
            // `oneOf`, based on what the configuration schema codegen will spit out.
            if let Some(all_of) = subschemas.all_of.as_ref() {
                return SchemaType::AllOf(all_of.iter().map(schema_to_simple_schema).collect());
            } else if let Some(one_of) = subschemas.one_of.as_ref() {
                return SchemaType::OneOf(one_of.iter().map(schema_to_simple_schema).collect());
            } else if let Some(any_of) = subschemas.any_of.as_ref() {
                return SchemaType::AnyOf(any_of.iter().map(schema_to_simple_schema).collect());
            } else {
                panic!(
                    "Encountered schema with subschema validation that wasn't one of the supported types: allOf, oneOf, anyOf."
                );
            }
        }

        if let Some(instance_types) = self.instance_type.as_ref() {
            return match instance_types {
                SingleOrVec::Single(single) => SchemaType::Typed(OneOrMany::One(*single.clone())),
                SingleOrVec::Vec(many) => SchemaType::Typed(OneOrMany::Many(many.clone())),
            };
        }

        if let Some(const_value) = self.const_value.as_ref() {
            return SchemaType::Constant(const_value);
        }

        if let Some(enum_values) = self.enum_values.as_ref() {
            return SchemaType::Enum(enum_values);

View on GitHub (pinned to bdb87aeaa4)