Was this helpful?
JSON v2
JSON v2 is a single mode connector that provides source and target connections to JSON data files.
JavaScript Object Notation (JSON) is an open-standard, text based, language-independent data format that is generally used to store and transmit data in web applications.
Note:  When creating a new map (manually or using the Map Wizard) and the target has no schema, DataConnect attempts to create one using the source schema. This is a straightforward process with a single record source to a single record target. The process differs with a multi-record (or hierarchical) source to multi-record target. In this case, DataConnect locates the first “flat” source record type (a record where none of the fields are themselves a record) and uses it to generate a basic schema for the target. Users can then build out the schema.
For more information about JSON, see the following resources:
IETF RFC 8259: https://datatracker.ietf.org/doc/html/rfc8259
ECMA-404: https://ecma-international.org/publications-and-standards/standards/ecma-404/
https://www.json.org
Connectivity Requirements
For the JSON v2 connector:
Source and target files can be stored on the local file system where Actian DataConnect is installed, and then accessed through shared storage locations.
Source and target connectors may be defined as a DJMessage type (djmessage:///<message name>).
Connector Parts
Connector parts are the fields you configure to connect with a data source or target. The fields that are available depend on the connector you select.
For a list of all parts for source connectors, see Specifying Source Connector, Parts, and Properties.
For a list of all parts for target connectors, see Specifying Target Connector, Parts, and Properties.
Connector Properties
You can specify the following source (S) and target (T) properties:
Property
S/T
Description
Batch Size
S
The number of records to return from the DMS connector at one time. A value of 0 returns all records.
Default value is 100.
Schema Sample Size
S
The maximum number of tokens read to build a schema.
Default value is 1000.
Read Null Values
S
Specifies whether null values are read. A null value is defined by the value of a name:value pair being explicitly set to Null.
TRUE (default): Null values are read in the source file.
FALSE: Null values are skipped in the source file. (The null field is added to the schema, but it is skipped during map execution.)
Read Empty Objects
S
Specifies whether empty objects ("ObjectName" : {}) are read.
TRUE: Empty objects are read and empty records are produced for them.
FALSE (default): Empty objects are skipped.
Read Empty Arrays
S
Specifies whether empty arrays ("ArrayName" : []) are read.
TRUE: Empty arrays are read and empty records are produced for them.
FALSE (default): Empty arrays are skipped.
Read Empty String As Null Object
S
In cases where the schema defines a field as an object and the field value is an empty string, this property specifies whether to read it as an empty object.
TRUE: Empty strings are read and empty records are produced for them.
FALSE: (default): Empty strings are skipped.
Wrapped Object Mode
S
Specifies whether to use a single named object (or array) child property of the root as the actual root for mapping.
TRUE: Assumes that the JSON document contains a single object (or array) child property and uses it as the root.
FALSE (default): Uses the outermost start object (“{“) or start array (“[“) as the root.
Discover Date/Time in Strings
S
Specifies whether to evaluate fields with string values during schema creation in order to identify these Discover ISO 8601 data types: date, datetime, and time.
TRUE (default): Fields with string values are evaluated. If a field contains strings that conform to the date, datetime, or time data type, the field is recorded as that data type in the schema. Properties for that field are subsequently read and/or written as that data type.
FALSE: Fields with string values are not evaluated and are recorded as string type in the schema.
Unparsable Date/Time Returns Null
S
Specifies connector behavior when it encounters a date, datetime or time value that it can't parse.
TRUE: A null value is returned as the value for the unparsable field.
FALSE (default): A null value will generate an error and the map (or data browsing) will likely end.
Flush Frequency
T
The number of records to send to the DMS at one time. Default value is 0 (all records are written at once).
Tip...  When inserting many records, change the default to a higher value to improve performance.
Batch Response
T
The name of the batch response file to which operation results are written. One entry is written per record, indicating success or failure. If an operation fails, information about the cause is returned. If not set, no batch response file is created. By default, no batch response file is written.
Write Empty Fields
T
Specifies whether empty (not null) fields are written.
TRUE (default): Empty fields are written as "FieldName": "".
FALSE: Empty fields are skipped.
Write Null Fields
T
Specifies whether null fields are written.
TRUE: Null fields are written as "FieldName": "".
FALSE (default): Null fields are skipped.
Write Null Objects
T
Specifies whether empty (not null) objects are written.
TRUE (default): Empty objects are written as "ObjectName": {}.
FALSE: Empty objects are skipped.
Wrapped Object Mode
T
Specifies whether to use a single named child property of the root as the actual root during schema creation.
TRUE: Uses the single named child property of the root as the actual root during schema creation. When writing, “wrap” the named root property inside an outer object.
FALSE (default): The named root property is not “wrapped” inside an outer object.
Discover Date/Time in Strings
T
Specifies whether to evaluate fields with string values during schema creation in order to identify these Discover ISO 8601 data types: date, datetime, and time.
TRUE (default): Fields with string values are evaluated. If a field contains strings that conform to the date, datetime, or time data type, the field is recorded as that data type in the schema. Properties for that field are subsequently read and/or written as that data type.
FALSE: Fields with string values are not evaluated, and are recorded as string type in the schema.
Formatted Output
T
Enables basic formatting of the output document.
TRUE: The output document is formatted.
FALSE (default): The output document is not formatted.
Supported Output Modes
JSON v2 connector supports the Replace output mode. For more information, see Target Output Modes.
Supported Data Types
JSON v2 connector supports the following data types and these data types correspond to the fields in the target data table:
Byte
Boolean
Char
Date
Datetime
Decimal
Double
Float
Integer
Long
Short
String
Time
Additional Information
Batch Response
A batch response file contains a group of entries for each connector used in a batch operation. Each action in the operation generates a batch response entry. These entries often provide detailed information, such as errors, that can be used for troubleshooting.
Example:
<BatchResponse:batchResult xmlns:BatchResponse="http://www.actian.com/BatchResponse">
<BatchResponse:results>
</BatchResponse:results>
<BatchResponse:componentInfo>
<BatchResponse:returnCode>0</BatchResponse:returnCode>
<BatchResponse:componentName>JSON-DMS</BatchResponse:componentName>
</BatchResponse:componentInfo>
</BatchResponse:batchResult>
Last modified date: 12/03/2024