WeAreDevelopers LIVE β€’ Oct 18, 2024

Tips and Tricks for Working with JSON

Dan Cranney

Stop crashing your Node apps with malformed JSON. Master ten advanced techniques to safely parse, sanitize, and deep clone your data effortlessly.

Pause
Mute Enter Fullscreen
#1 about 2 min

Gracefully handling invalid formatted JSON data

Using a try-catch block during file reading prevents applications from crashing on malformed syntax.

#2 about 1 min

Implementing a simple JSON validation function

Wrapping the parsing method in a reusable function cleanly returns a boolean status for validity checks.

#3 about 1 min

Formatting stringified output for better readability

Passing spacing arguments into stringify operations adds structured indentation for easier visual inspection.

#4 about 2 min

Filtering specific fields with a replacer function

Supplying a replacer parameter during stringification efficiently excludes sensitive keys like passwords or emails.

#5 about 1 min

Transforming parsed data using a reviver function

Applying a reviver function to parsing intercepts specific keys to cast string values into appropriate formats like date objects.

#6 about 1 min

Deep cloning objects to prevent mutating original data

Serializing and immediately deserializing data creates completely independent object copies to safely manipulate values.

#7 about 1 min

Converting JSON object properties into query strings

Mapping over object keys and encoding values enables the construction of valid URL query parameters.

#8 about 1 min

Generating dynamic objects from independent array lists

Iterating over parallel lists of keys and values programmatically constructs complete and matching data structures.

#9 about 1 min

Shallow merging multiple objects via spread operators

Destructuring existing structures into a new object efficiently applies partial updates and overwrites duplicate keys.

#10 about 2 min

Extracting nested data collections directly with flatMap

Invoking flatMap immediately retrieves and naturally flattens internal lists from complex nested hierarchies.

Matching moments

2:32 min

Dealing with mixed payloads and structural patterns

Olena Kutsenko Β· WWC 2022

1:28 min

Optimizing performance across JSON methodologies and backend stacks

Alen Pokos Β· LIVE

3:18 min

Leveraging the JSON API standard for data structure

Alen Pokos Β· LIVE

2:37 min

Handling complex data structures with records and pattern matching

Christoph Christoph Β· WWC 2024

2:29 min

Preventing secret exposure when parsing structured data formats

Chris Ayers Β· LIVE

2:11 min

Adopting JSON Structure as a strict data definition language

Clemens Vasters Clemens Vasters Β· WWC 2025

Upcoming sessions on this topic

Open session

World Congress 2026 North America

Testing React Backends Like a Pro: Mocking Databases with SQLite

David Morris

Solution Architect

David Morris
Open session

World Congress 2026 North America

Designing APIs That Survive AI Agents at Scale

Phani Pendurthi

Mastercard, Principal Software Engineer

Phani Pendurthi
Open session

World Congress 2026 North America

Beyond Vibe Coding: An AI Builder’s Guide to Migrating 10k+ React Components

Shubham Chaurasia

Senior Software Engineer @ Meta

Shubham Chaurasia
Open session

World Congress 2026 North America

API = Some REST and HTTP, right? RIGHT?!

Rustam Mehmandarov

Passionate computer scientist

Rustam Mehmandarov
Open session

World Congress 2026 North America

Offloading IoT State: Solving the Memory Crisis on Legacy Hardware

Pravin Nagare

Senior Software Engineer, Roku

Pravin Nagare
Open session

World Congress 2026 North America

AI-Driven API Design

Mike Amundsen

Author, Adviser, Trainer

Mike Amundsen