Code
try json.get("permissions") as [String]
Input
Error
{
"debugReason": "No value found at path '', expected 'String'",
"error": true,
"identifier": "Node.NodeError.unableToConvert",
"possibleCauses": [
"typo in key path",
"underlying type is not convertible",
"unexpected '.' being interpreted as path instead of key"
],
"reason": "Internal Server Error",
"suggestedFixes": [
"called `get(...)` on a key or key path that does not exist in the data",
"the data being parsed is missing required values or is incorrectly formatted",
"found unconvertible data, e.g., got a string of letters when an integer is required",
"if you have keys containing a '.' that shouldn't be interpreted as a path, use 'DotKey(\"actual.key\")'"
]
}
Code
Input
{ "userId": "xxx" }Error
{ "debugReason": "No value found at path '', expected 'String'", "error": true, "identifier": "Node.NodeError.unableToConvert", "possibleCauses": [ "typo in key path", "underlying type is not convertible", "unexpected '.' being interpreted as path instead of key" ], "reason": "Internal Server Error", "suggestedFixes": [ "called `get(...)` on a key or key path that does not exist in the data", "the data being parsed is missing required values or is incorrectly formatted", "found unconvertible data, e.g., got a string of letters when an integer is required", "if you have keys containing a '.' that shouldn't be interpreted as a path, use 'DotKey(\"actual.key\")'" ] }