Skip to content

NestedTypeDto: model and generate fields and constructors for nested types #487

Done

Description

@igel-devin-ai

Problem

NestedTypeDto in the codegen model currently only carries methods (plus type name, kind, visibility, generic parameters, javadoc and annotations). Fields and constructors are not modeled at all, so nested types generated by the backends can never declare them.

This surfaced during generation-target validation (#465 / #479): the validator recurses into nested types for method validation, but there is nothing to validate for fields and constructors because the model does not have them. Any DTO that conceptually needs a nested type with state or construction logic cannot express it today.

Proposal

  • Extend NestedTypeDto (and its builder) with fields and constructors, mirroring what GenerationTargetClassDto already models
  • Extend the backends (Roaster first) to render them
  • Extend GenerationTargetValidator recursion: validateFields/validateConstructors already take plain lists, so wiring them into nested-type validation is trivial once the model carries the data

Notes

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