node
node copied to clipboard
ambiguous error
Code
try json.get("permissions") as [String]
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\")'"
]
}
Yeah, I just lost an hour hunting down what was causing this problem. I had renamed a key on the server side, but forgot to update the parameter name in the Rested app. Sure wish this error gave you the specific key that caused the error.
@ThuggishNuggets that's something we're working on in the next version. Updating this issue to reflect that.