Object Data Type v2

An Object contains named fields. The authored type object represents structured JSON values, dictionaries, and custom Node contract types.

Object values can be null. Some weakly typed Node inputs and outputs use Object when the runtime value may have one of several concrete types; follow the selected Method's contract rather than assuming every Object shape is interchangeable.

Define an Object shape

Declare the fields beneath Properties:

Customer:
  Type: object
  Properties:
    id:
      Type: string
    active:
      Type: boolean

The receiving Node Method can supply a published shape. Preserve that contract and map compatible data into its fields.

Map or construct an Object

Put an Expression on the Object when the target accepts an upstream object directly:

Customer:
  Type: object
  Expression: "{getCustomer.Customer}"

Map child fields when you need to select, rename, or construct a shape:

Customer:
  Type: object
  Properties:
    id:
      Type: string
      Expression: "{getCustomer.Customer.customerId}"
    displayName:
      Type: string
      Expression: "{getCustomer.Customer.name}"

Do not assign a complex object through literal Value. Use nested Properties, a compatible runtime Expression, or a document parser.

Object and JSON are different concepts

An Object is parsed structured data whose fields can be mapped. JSON text is a String, and a large JSON body can be a Stream. Use an appropriate Node to parse JSON text or content before mapping it as an Object or Array.

Some weakly typed Node Parameters accept several runtime shapes. Do not assume every Object accepts every value; the selected Node Method remains the authoritative contract.

See also

See Data Types, Array Data Type, and Data mapping.