{"record":{"id":"7fbeb5bf0787008d","repo":"elsa-workflows/elsa-core","slug":"input-inputname-of-the-activitytype-binding-does-not-hold","errorCode":null,"errorMessage":"Input '{inputName}' of the '{activityType}' binding does not hold valid JSON: {exception.Message}","messagePattern":"Input '(.+?)' of the '(.+?)' binding does not hold valid JSON: (.+?)","errorType":"exception","errorClass":"BpmnBindingException","httpStatus":null,"severity":"error","filePath":"src/modules/Elsa.Bpmn.Interchange/Binding/BpmnActivityBindingFormat.cs","lineNumber":267,"sourceCode":"                var noun = undeclaredInputNames.Count == 1 ? \"an input\" : \"inputs\";\n                var names = string.Join(\", \", undeclaredInputNames.Select(name => $\"'{name}'\"));\n\n                throw new BpmnBindingException($\"The '{activityType}' binding declares {noun} {names}, which '{activityType}' does not have.\");\n            }\n        }\n\n        return activity;\n    }\n\n    private static JsonNode? Parse(string? json, string inputName, string activityType)\n    {\n        try\n        {\n            return JsonNode.Parse(json ?? \"null\");\n        }\n        catch (JsonException exception)\n        {\n            throw new BpmnBindingException($\"Input '{inputName}' of the '{activityType}' binding does not hold valid JSON: {exception.Message}\");\n        }\n    }\n\n    private static BpmnForeignAttribute Attribute(string name, string value) => new(new(null, name), value);\n\n    // An unprefixed XML attribute belongs to no namespace, which is what the reader records for these; comparing on\n    // the local name alone would also match a same-named attribute some other vendor put in its own namespace.\n    private static string? AttributeOf(BpmnExtensionElement element, string name) =>\n        element.Attributes.FirstOrDefault(attribute => string.IsNullOrEmpty(attribute.Name.Namespace) && attribute.Name.LocalName == name)?.Value;\n}\n","sourceCodeStart":249,"sourceCodeEnd":278,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Bpmn.Interchange/Binding/BpmnActivityBindingFormat.cs#L249-L278","documentation":"Thrown by the private Parse helper of BpmnActivityBindingFormat (invoked while reading binding inputs) when a declared binding input, expected to be JSON, cannot be parsed by JsonNode.Parse. It is a validation guard translating the underlying JsonException into a BpmnBindingException that names the offending input and activity type; null input is coerced to JSON null and does not fire.","triggerScenarios":"BpmnActivityBindingFormat.Parse (called from Read) invokes JsonNode.Parse on an <elsa:input> element's value and a JsonException is thrown — e.g. unquoted text, trailing commas, or raw identifiers.","commonSituations":"Writing <elsa:input name=\"X\">hello</elsa:input> instead of quoted JSON \"hello\"; pasting C#/XML snippets instead of JSON; empty or malformed values from manual edits.","solutions":["Quote string values and fix the JSON syntax of the named input so JsonNode.Parse succeeds.","Check the inner message for the exact position of the JSON syntax error and correct that character/structure.","For non-string values, use proper JSON (numbers, true/false, arrays, objects) rather than XML-ish text."],"exampleFix":"// before\n<elsa:input name=\"Count\">3 items</elsa:input>\n// after\n<elsa:input name=\"Count\">3</elsa:input>","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"static bool IsParsableJson(string? s)\n{\n    if (string.IsNullOrWhiteSpace(s)) return true;\n    try { JsonNode.Parse(s); return true; } catch (JsonException) { return false; }\n}","tryCatchPattern":"try { await importer.ImportAsync(bpmn); }\ncatch (BpmnBindingException ex) when (ex.Message.Contains(\"does not hold valid JSON\"))\n{\n    logger.LogError(ex, \"An <elsa:input> value is not valid JSON; quote strings and fix syntax.\");\n}","preventionTips":["Always quote string input values: <elsa:input>\"text\"</elsa:input>","Validate each input's text with JsonNode.Parse before import","Never paste raw prose or C# expressions as input values"],"tags":["bpmn","json","parse-error"],"backgroundTag":"json-parse-error","analyzedSha":"fe9217bdfa0e27f0e09e45006eb6898f616e513d","analyzedAt":"2026-09-13T20:32:34.702Z","contentChangedAt":"2026-09-13T20:32:34.702Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}