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

    Represents a Data Transfer Object (DTO) or Enum model in the IR. Each IrModel corresponds to one generated TypeScript class/enum file.

    interface IrModel {
        description?: string;
        discriminator?: string;
        enumValues?: string[];
        extends?: string;
        fileName: string;
        isEnum: boolean;
        name: string;
        properties: IrProperty[];
        subTypes?: { name: string; value: string }[];
    }
    Index

    Properties

    description?: string

    Optional description from the OpenAPI schema. Used to generate JSDoc comments in the output DTO.

    discriminator?: string

    The name of the discriminator property for polymorphic handling. Used when this model is the parent of a discriminated union (oneOf with discriminator).

    'type' for schemas where type='cat'|'dog' determines the subtype
    
    enumValues?: string[]

    The enum values when isEnum is true. Each string represents one enum member value.

    ['ADMIN', 'USER', 'GUEST']
    
    extends?: string

    The name of the parent class this model extends (for inheritance via allOf). When present, the generated class will use extends ParentClass.

    'BaseEntity'generates: `export class User extends BaseEntity { ... }`
    
    fileName: string

    The base filename in kebab-case without extension. Used for generating file paths and import module specifiers. Always uses the original schema name, regardless of reserved word conflicts.

    'user-profile' (generates user-profile.dto.ts)
    
    'record' (generates record.dto.ts, even though class is Record_)
    
    'user-role' (generates user-role.enum.ts)
    
    isEnum: boolean

    Indicates if this model represents a TypeScript enum. When true, generates an enum file instead of a DTO class file.

    name: string

    The sanitized TypeScript class/enum name. Safe to use as a TypeScript identifier (reserved words are suffixed with '_').

    'UserProfile'
    
    'Record_' (for the reserved word 'Record')
    
    'UserRole' (enum)
    
    properties: IrProperty[]

    The list of properties/fields for this DTO. Empty for enums or pure oneOf type aliases.

    subTypes?: { name: string; value: string }[]

    The list of subtypes for discriminated unions (oneOf schemas). Each entry maps a discriminator value to a concrete class name. For pure oneOf models, this is used to generate type alias unions instead of classes.

    [{ name: 'Cat', value: 'cat' }, { name: 'Dog', value: 'dog' }]
    
    Generates: `export type Animal = Cat | Dog;` (pure oneOf)