json. isNull Synchronous
Distinguish an explicit JSON null from a missing field. That difference matters in patches where null means “clear this value” and an absent key means “leave it alone.”
Luau
json.isNull(value: any) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
value | any | Value to compare with json.null. |
Returns
booleantrue only for the json.null singleton. Luau nil is not json.null.
Usage notes
Default decoding preserves null as json.null. Passing useNull=false can instead discard object fields or leave holes in arrays.
Example
Luau
local update = json.decode('{"nickname":null}')
print(json.isNull(update.nickname)) -- true
print(update.missing == nil) -- true