💬 Welcome back to Code With Sally – today’s video is a special Q&A edition!
❓ One attendee asked:
*“Do I have to include all the fields from a JSON response when creating a wrapper class in Apex?”*
🎯 In this short, focused video, we’ll explore:
Whether it's okay to skip some fields when deserializing JSON
What happens when a field is missing from the wrapper
How to design minimal and effective Apex wrapper classes
Why field *names must match* exactly to be deserialized
💡 We use a real JSON response from a country API and test:
A full wrapper class
A version with *only one* field
A version with *select fields* (like `capital`, `currencies`, etc.)
A version with a *mismatched field name*
📌 **Timestamps**:
00:00 – Welcome & Channel Overview
00:53 – Q&A: Do You Need All JSON Fields in Apex Wrappers?
10:33 – Wrap-up & Thanks!
🎥 This is part of our *Q&A: Salesforce Development | Code With Sally* playlist.
📂 More resources:
Country API: https://publicapi.dev/rest-countries-api
Blog: https://codewithsally.com
LinkedIn: / sallyelghoul
🔔 Don’t forget to like, comment, and subscribe to support the channel!
#SalesforceApex #JSONDeserialization #ApexWrappers #SalesforceDevelopment #CodeWithSally #ApexCoding
=============================================================
Music: https://www.bensound.com
License code: EJGFJ628FIWLNTRX
Music by: https://www.bensound.com
License code: GZZCTVUFTP5IC5MQ