Skip to content

[Bug]: Schema.buildTypes() does not inherit parent types #118

@Splatcrafter

Description

@Splatcrafter

AI REVIEWED

Module: api
File: api/schema/Schema.java (~line 179-195)
Severity: Critical

Summary

In Schema.buildTypes(), this.parent.types() is called but the result is never used. Child schemas do not inherit any types from their parent, requiring all types to be re-registered in every subclass.

Expected Behavior

A child schema should inherit type definitions from its parent schema. Only new or overridden types need to be registered in the child.

Actual Behavior

Parent types are fetched but discarded. Subclasses must re-register all types they need, violating the DRY principle and making schema evolution error-prone.

Suggested Fix

Copy parent types into the child's TypeRegistry before calling registerTypes(), or clearly document this as an intentional design decision if inheritance is not desired.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions