Skip to content

[Bug]: ConventionChecker silently skips null types without warning #173

@Splatcrafter

Description

@Splatcrafter

AI REVIEWED

Module: schema-tools
File: schematools/validation/ConventionChecker.java (~line 143-146)
Severity: Medium

Summary

When schema.types().get(ref) returns null, field name checking is silently skipped. No warning is emitted, hiding potential configuration issues.

Expected Behavior

A warning should be emitted when a registered type reference cannot be resolved to an actual Type.

Actual Behavior

final Type<?> type = schema.types().get(ref);
if (type != null) {
    checkFieldNames(type, typeName, schemaLocation, rules, result);
}
// else: silently ignored

Suggested Fix

if (type == null) {
    result.add(ValidationIssue.warning("CONVENTION_TYPE_NOT_FOUND",
        "Type '" + typeName + "' is registered but cannot be resolved",
        schemaLocation));
} else {
    checkFieldNames(type, typeName, schemaLocation, rules, result);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions