The JSON Builder node constructs JSON objects with type coercion from expressions or default values, providing a structured way to build complex JSON.Documentation Index
Fetch the complete documentation index at: https://hypha-docs.plinqx.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
JSON Builder nodes enable:- Structured JSON: Build complex JSON structures
- Type Safety: Ensure correct data types
- Expression Binding: Use expressions for field values
- Default Values: Provide default values for fields
How It Works
Configuration
Field Definitions
Define fields with:- Name: Field name in output JSON
- Type: Data type (string, number, boolean, object, array, null)
- Expression: Expression to evaluate (optional)
- Default Value: Default value if expression is null/undefined (optional)
Field Types
Primitive Types
- String: Text values
- Number: Numeric values
- Boolean: True/false values
- Null: Null values
Complex Types
- Object: Nested objects with properties
- Array: Arrays with item schema
Example Configuration
Type Coercion
JSON Builder automatically coerces values to specified types:- String: Converts to string
- Number: Converts to number (validates numeric)
- Boolean: Converts to boolean
- Array: Validates array structure
- Object: Validates object structure
Nested Structures
Build nested objects and arrays:- Nested Objects: Define object fields with properties
- Arrays: Define array fields with item schema
- Deep Nesting: Support multiple levels of nesting
Use Cases
- API Requests: Build structured request bodies
- Data Transformation: Transform data into specific formats
- Response Construction: Build consistent response structures
- Schema Compliance: Ensure data matches schemas
Best Practices
Define Schema
Clearly define field types and structure
Use Defaults
Provide default values for optional fields
Validate Types
Ensure expressions return correct types
Document Structure
Document complex nested structures
Next Steps
VALIDATE Node
Validate built JSON against schema
Transform Node
Alternative for simple transformations