AutoBE
    Preparing search index...

    Property assignment for object literal construction.

    Represents individual key-value pairs within object literals. Critical for building request bodies, configuration objects, and structured data that conforms to API schemas and business requirements, particularly for use in IApiOperateStatement operations.

    E2E testing importance: Each property assignment must align with DTO schema requirements to ensure valid API requests and realistic business data representation.

    AI function calling requirement: Property names and value types must match target schema definitions exactly, especially when used for API operation parameters.

    interface IPropertyAssignment {
        name: string & MinLength<1>;
        type: "propertyAssignment";
        value: IExpression;
    }
    Index

    Properties

    Properties

    name: string & MinLength<1>

    Property name (object key).

    Must correspond to actual property names defined in target DTO schemas, API specifications, or business data models. Should use camelCase convention matching TypeScript interfaces.

    API context: When used in request bodies for API operations, must exactly match the expected parameter names in the API specification.

    Examples:

    • "name" for entity names in API requests
    • "email" for contact information in API calls
    • "price" for monetary values in business API operations
    • "createdAt" for timestamps in API responses
    • "isActive" for boolean flags in API parameters

    AI validation requirement: Ensure property names exist in the target schema and follow exact naming conventions used in API specifications.

    type: "propertyAssignment"

    Type discriminator for property assignments.

    Always "propertyAssignment" to distinguish from other object construction mechanisms in the AST.

    Property value expression.

    Expression that evaluates to the property value. Type must match the expected type for this property in the target schema. Should represent realistic business data appropriate for the property's purpose.

    • ⚠️ CRITICAL AI RESTRICTION: This MUST be an AST expression, NOT a raw value! ⚠️
    • ❌ WRONG: "John Doe" (raw string)
    • ❌ WRONG: 123 (raw number)
    • ❌ WRONG: true (raw boolean)
    • ✅ CORRECT: IStringLiteral, INumericLiteral, IBooleanLiteral (AST expressions)

    API usage: When used in API operation parameters, must generate values compatible with the API specification requirements.

    Common patterns:

    • String literals for names, descriptions, codes in API requests
    • Numeric literals for quantities, prices, scores in API calls
    • Boolean literals for flags and states in API parameters
    • Object literals for nested business data in API requests
    • Array literals for collections in API operations
    • Random generators for variable test data in API calls
    • Identifiers for referencing captured data from previous API operations

    AI type matching: Must generate expressions that produce values compatible with the target property's schema type and API constraints.