jo_pearson
02/03/2022, 4:17 PM{
"type": ["null", "object"],
"additionalProperties": false,
"definitions": {
"Address": {
"type": ["null", "object"],
"properties": {
"name": { "type": ["null", "string"] },
"company": { "type": ["null", "string"] },
"street1": { "type": ["null", "string"] },
"street2": { "type": ["null", "string"] },
"street3": { "type": ["null", "string"] },
"city": { "type": ["null", "string"] },
"state": { "type": ["null", "string"] },
"postalCode": { "type": ["null", "string"] },
"country": { "type": ["null", "string"] },
"phone": { "type": ["null", "string"] },
"residential": { "type": ["null", "boolean"] },
"addressVerified": { "type": ["null", "string"] }
}
},
"OrderItem": {
"type": ["null", "object"],
"properties": {
"orderItemId": { "type": ["null", "integer"] },
"lineItemKey": { "type": ["null", "string"] },
"sku": { "type": ["null", "string"] },
"name": { "type": ["null", "string"] },
"imageUrl": { "type": ["null", "string"] },
"weight": { "$ref": "#/definitions/Weight" },
"quantity": { "type": ["null", "integer"] },
"unitPrice": { "type": ["null", "number"] },
"taxAmount": { "type": ["null", "number"] },
"shippingAmount": { "type": ["null", "number"] },
"warehouseLocation": { "type": ["null", "string"] },
"options": {
"type": ["null", "array"],
"items": { "$ref": "#/definitions/ItemOption" }
},
"productId": { "type": ["null", "integer"] },
"fulfillmentSku": { "type": ["null", "string"] },
"adjustment": { "type": ["null", "boolean"] },
"upc": { "type": ["null", "string"] },
"createDate": { "type": ["null", "string"] },
"modifyDate": { "type": ["null", "string"] }
}
},
And they are referenced like this at the bottom of the file:
"properties": {
"billTo": { "$ref": "#/definitions/Address" },
"shipTo": { "$ref": "#/definitions/Address" },
"items": {
"type": ["null", "array"],
"items": { "$ref": "#/definitions/OrderItem" }
},
Both objects flatten correctly in target-redshift pipelinewise, but only the address object flattens in target postgres pipelinewise.