Optional
argumentSingle argument object for the API function call.
CRITICAL: All API functions accept exactly one object parameter that contains all necessary data for the operation. This argument object is constructed based on the API operation's specification and follows a standardized structure.
⚠️ CRITICAL AI RESTRICTION: This MUST be an AST expression, NOT a JSON value! ⚠️ ❌ WRONG: { "name": "John", "age": 30 } (raw JSON object) ✅ CORRECT: IObjectLiteralExpression with proper AST structure
Object Structure Rules:
The argument object is constructed by combining path parameters and request body data according to the following rules based on the target AutoBeOpenApi.IOperation:
Path Parameters: Each parameter from
AutoBeOpenApi.IOperation.parameters
becomes a property in the
argument object, where:
AutoBeOpenApi.IParameter.name
AutoBeOpenApi.IParameter.schema
{ saleId: "uuid-string", customerId: "another-uuid" }
Request Body: If AutoBeOpenApi.IOperation.requestBody
exists:
body
property containing the request body data{ body: { name: "Product Name", price: 99.99 } }
Combined Structure: When both path parameters and request body exist:
{
// Path parameters as individual properties
"saleId": "uuid-value",
"customerId": "another-uuid",
// Request body as 'body' property
"body": {
"name": "Updated Product",
"price": 149.99,
"description": "Enhanced product description"
}
}
Special Cases:
parameters
is empty array AND requestBody
is
null, set this to null
(the API function requires no arguments)requestBody
is null but parameters
exist, create object with only path parameter propertiesparameters
is empty but requestBody
exists, create object with only the body
propertyAI Construction Strategy:
AutoBeOpenApi.IOperation
specificationbody
propertyType Safety Requirements:
Business Context Examples:
// GET /customers/{customerId}/orders/{orderId} (no request body)
{
customerId: "cust-123",
orderId: "order-456"
}
// POST /customers (only request body)
{
body: {
name: "John Doe",
email: "john@example.com",
phone: "+1-555-0123"
}
}
// PUT /customers/{customerId}/orders/{orderId} (both path params and body)
{
customerId: "cust-123",
orderId: "order-456",
body: {
status: "shipped",
trackingNumber: "TRACK123",
estimatedDelivery: "2024-12-25"
}
}
// GET /health (no parameters or body)
null
API endpoint specification defining the operation to be called.
Contains the HTTP method and path information that identifies which specific API operation from the OpenAPI specification should be invoked. This corresponds to operations defined in the AutoBeOpenApi.IDocument.
The endpoint determines the expected parameter types, request body schema, and response body schema for proper type validation.
Type discriminator.
Optional
variableOptional variable name for capturing the API response with automatic data handling.
Conditional Usage:
string
: When API operation returns data that needs to be captured
const variableName: ApiResponseType = typia.assert<ResponseType>(await api.operation(...))
null
: When API operation returns void or response is not needed
await api.operation(...)
AI Decision Logic:
Variable naming should follow business domain conventions (e.g., "customer", "order", "product") rather than technical naming. This automatic data capture eliminates the need for separate variable declaration statements.
API operation statement for SDK function calls with automatic response handling and data capture.
This statement type handles the complete lifecycle of API operations including:
This is the primary mechanism for all API interactions in E2E test scenarios, providing integrated data capture that eliminates the need for separate variable declarations.
The statement automatically handles the complex pattern of API calling, response capturing, and type validation that is essential for robust E2E testing.
AI function calling importance: Use this for ALL SDK API operations to ensure proper response handling, automatic data capture, and type safety in business test scenarios.