Skip to content

Support recursive resolution of tm:extends in models referenced via tm:ref #2200

@hu-ahmed

Description

@hu-ahmed

Currently, models referenced via tm:ref do not inherit fields from their extended base models. While this may not cause immediate functional issues, it prevents effective reuse of common model structures and leads to unnecessary duplication of fields across Thing Models. This makes it harder to maintain consistency and utilize inheritance as intended by the WoT modeling approach.

Ditto should:

  • Detect when a ThingModel referenced via tm:ref includes a tm:extends link.
  • Resolve and merge the base model and all inherited fields recursively.
  • Use the fully resolved structure for:
  • Schema validation
  • API responses
  • TD generation

This behavior would match how tm:submodel and tm:extends are already handled when Ditto processes top-level features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions