# JSON - The Fine Print: Part 3 - Zero vs Missing Values

DevFeed: [JSON - The Fine Print: Part 3 - Zero vs Missing Values](<https://devfeed.tech/articles/json-the-fine-print-part-3-zero-vs-missing-values-22281.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2025/05/json-the-fine-print-part-3.html>)

Published: 2025-05-19T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [JSON](<https://devfeed.tech/topics/json.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [api-layers](<https://devfeed.tech/tags/api-layers.md>), [code](<https://devfeed.tech/tags/code.md>), [common-serialization-errors](<https://devfeed.tech/tags/common-serialization-errors.md>), [data-serialization](<https://devfeed.tech/tags/data-serialization.md>), [data-structure-separation](<https://devfeed.tech/tags/data-structure-separation.md>), [data-transmission](<https://devfeed.tech/tags/data-transmission.md>), [data-validation](<https://devfeed.tech/tags/data-validation.md>), [encoding-json](<https://devfeed.tech/tags/encoding-json.md>), [go](<https://devfeed.tech/tags/go.md>), [go-json-types](<https://devfeed.tech/tags/go-json-types.md>), [go-language-serialization](<https://devfeed.tech/tags/go-language-serialization.md>), [go-language-validation](<https://devfeed.tech/tags/go-language-validation.md>), [go-type-mapping](<https://devfeed.tech/tags/go-type-mapping.md>), [json](<https://devfeed.tech/tags/json.md>), [json-best-practices](<https://devfeed.tech/tags/json-best-practices.md>), [json-go-mapping](<https://devfeed.tech/tags/json-go-mapping.md>), [json-marshaling](<https://devfeed.tech/tags/json-marshaling.md>), [json-unmarshaling](<https://devfeed.tech/tags/json-unmarshaling.md>), [json-validation](<https://devfeed.tech/tags/json-validation.md>), [passing-serialized-data](<https://devfeed.tech/tags/passing-serialized-data.md>), [rest-apis](<https://devfeed.tech/tags/rest-apis.md>), [schema-less-data-format](<https://devfeed.tech/tags/schema-less-data-format.md>), [serialization](<https://devfeed.tech/tags/serialization.md>), [serialization-mistakes](<https://devfeed.tech/tags/serialization-mistakes.md>), [serialization-protocols](<https://devfeed.tech/tags/serialization-protocols.md>), [unmarshalling](<https://devfeed.tech/tags/unmarshalling.md>)

## AI overview

This tutorial examines how to distinguish zero values from missing or NULL fields when consuming JSON in Go. It explains basic unmarshalling into structs, notes that absent fields do not cause errors, and introduces DisallowUnknownFields for validating exact JSON input.

## Source excerpt

Introduction In part 1 we took a higher level view on serialization in general and JSON in specific. In part 2 we looked at emitting JSON. In part 3, we'll look at an issue you might encounter when consuming JSON, Zero vs NULL field values. To clarify the definition of NULL, this means the absence of value. So here is the question: Given a field in a Go struct set to its zero value, how do you know that zero value was set by the user or it's zero because it was never provided?