Skip to main content

JSON

Parse, create, manipulate, and serialize JSON data structures for working with APIs, configuration files, and data interchange.

Overview

The JSON package provides comprehensive JSON handling capabilities. Use it when you need to parse JSON responses from APIs, create JSON payloads for requests, manipulate JSON objects, or read/write JSON files.

Key Features

  • Parse & Serialize - Convert between JSON strings and objects
  • Create & Modify - Build and update JSON structures
  • Access Values - Get and set values by key or path
  • File Operations - Read and write JSON files
  • Object Utilities - Clone, get keys, delete properties

Available Nodes

  • Decode - Parse JSON string into object
  • Encode - Convert object to JSON string
  • Create - Create a new empty JSON object
  • Get - Get value by key or JSON path
  • Set - Set value by key or JSON path
  • Delete - Remove a property from JSON object
  • Keys - Get all keys from JSON object
  • Values - Get all values from JSON object
  • Clone - Create a deep copy of JSON object
  • Read - Read and parse JSON from file
  • Write - Write JSON object to file

When to Use This Package

  • API Integration: Parse API responses and create request bodies
  • Configuration: Read and write JSON config files
  • Data Transformation: Convert and restructure data
  • Data Storage: Store structured data in JSON format
  • Message Handling: Process JSON messages from queues

Typical Workflow

  1. Decode JSON string from API response
  2. Get specific values using keys or paths
  3. Set new values or modify existing ones
  4. Encode back to string for API requests
  5. Or Write to file for persistence

JSON Path Examples

Access nested data using dot notation:

  • user.name - Get name from user object
  • items[0].price - Get price from first item in array
  • data.results[*].id - Get all IDs from results array

Common Use Cases

  • Extract specific fields from API responses
  • Build complex nested objects for API requests
  • Transform data between different JSON structures
  • Merge multiple JSON objects
  • Validate and clean JSON data