Type identifier:
file:json:parseCategory: File Operations
The File - JSON Parse node reads a JSON file and parses its contents into a structured data object, validated against a configurable Schema. It supports standard JSON as well as JSONC (JSON with Comments) format and allows trailing commas for more lenient parsing.
Handle | Type | Description |
|---|---|---|
|
| The JSON file to parse. |
Handle | Type | Description |
|---|---|---|
| schema-defined | The parsed and validated JSON data matching the configured Schema. |
Option | Type | Default | Description |
|---|---|---|---|
Allow Comments |
|
| Enable JSONC format to allow JavaScript-style comments ( |
Allow Trailing Commas |
|
| Allow trailing commas after the last item in arrays and objects. |
Schema | literal | reference | literal | Schema for validating and typing the parsed data. |
The Schema can be configured in two modes:
Configuration:
falsefalseSchema (literal):
{
type: "object",
properties: {
customerId: { type: "string" },
name: { type: "string" },
email: { type: "string" },
purchaseHistory: {
type: "array",
items: {
type: "object",
properties: {
productId: { type: "string" },
quantity: { type: "number" },
date: { type: "string" }
}
}
}
}
}Input file (customer-data.json):
{
"customerId": "CUST-12345",
"name": "Jane Smith",
"email": "jane.smith@example.com",
"purchaseHistory": [
{
"productId": "PROD-001",
"quantity": 2,
"date": "2024-01-15"
},
{
"productId": "PROD-042",
"quantity": 1,
"date": "2024-02-03"
}
]
}Output (data):
{
"customerId": "CUST-12345",
"name": "Jane Smith",
"email": "jane.smith@example.com",
"purchaseHistory": [
{
"productId": "PROD-001",
"quantity": 2,
"date": "2024-01-15"
},
{
"productId": "PROD-042",
"quantity": 1,
"date": "2024-02-03"
}
]
}Configuration:
Use case: Parse a cached JSON response and validate it against a known Schema.