json.at_or_default(key, defaultval) #1852
Labels
kind: enhancement/improvement
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
This tends to be a lot of boilerplate to ensure something's there. I just want to supply a default within the single line if the key does not exist in the json struct.
json.at_or_default("nonexistantkey", "default")
should return "default", as the key does not exist.However,
json.at_or_default("existing", "default") // "existing" exists, and contains "nondefault"
should return "nondefault" as the key does exist.The text was updated successfully, but these errors were encountered: