Nog CLI Developer Guide - v0.10.5
    Preparing search index...

    Generates Data Transfer Object (DTO) and Enum files from the Internal Representation.

    Emission Strategy:

    • Pure OneOf Models: Union types with discriminator but no properties → rendered as type aliases.
    • Hybrid Models: Classes with properties, inheritance, or mixed composition → rendered as classes with validation decorators.
    • Enums: Simple value enumerations → rendered as TypeScript enums with sanitized member names.

    Each model is emitted with:

    • Class-validator decorators for runtime validation.
    • Class-transformer type hints for deserialization.
    • JSDoc documentation from OpenAPI schema descriptions.
    • Standard file header with generation metadata.
    Index

    Constructors

    Methods

    Constructors

    • Instantiates the DTO writer.

      Parameters

      • project: Project

        The ts-morph Project instance for AST manipulation.

      • outputDir: string

        The target directory where DTO files will be written.

      • allModels: IrModel[] = []

        The complete list of IR models (used for resolving cross-references and parent types).

      • specTitle: string = 'Unknown Spec'

        The OpenAPI specification title for file header metadata.

      • specVersion: string = 'Unknown Version'

        The OpenAPI specification version for file header metadata.

      Returns DtoWriter

    Methods