IBM Streams 4.2.1

Namespace com.ibm.streamsx.json

JSON support for SPL. A JSON object is encoded within a tuple as an rstring attribute containing the serialized object using UTF-8 encoding. The common paradigm is to use an attribute named jsonString, Json may be used to represent a complete tuple that is just a JSON object, or an attribute within a stream schema.

Tuples are converted to JSON objects using the operator TupleToJSON or the function tupleToJSON(T). SPL values are converted using the functions toJSON(S,T) or mapToJSON(map<S,T>).

Operators

  • JSONToTuple: This operator converts JSON strings into SPL Tuples.
  • TupleToJSON: This operator converts incoming tuples to JSON String.

Functions

  • mapToJSON(map<S, T>): Convert a map to JSON object encoded as a serialized JSON string.
  • toJSON(S, T): Convert a value to JSON object with a single key encoded as a serialized JSON string.
  • tupleToJSON(T): Convert a tuple to JSON object encoded as a serialized JSON String.

Types

  • Json: Default tuple type for representing JSON object.