{"record":{"id":"d9da39874248f419","repo":"xai-org/x-algorithm","slug":"symbols-are-not-supported-in-strato-json","errorCode":null,"errorMessage":"Symbols are not supported in strato JSON","messagePattern":"Symbols are not supported in strato JSON","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java","lineNumber":258,"sourceCode":"      prot.writeString(value.getValue());\n    }\n\n    @Override\n    protected Symbol deserialize(TProtocol prot) throws TException {\n      return new Symbol(prot.readString());\n    }\n\n    @Override\n    protected void toScript(GenScript script, Symbol value) {\n      script.builder\n          .append(\"`\")\n          .append(value.getValue())\n          .append(\"`\");\n    }\n\n    @Override\n    protected void toStratoJson(GenScript script, Symbol value) {\n      throw new IllegalArgumentException(\"Symbols are not supported in strato JSON\");\n    }\n  };\n\n  public static final Serializer<Long> LONG = new Serializer<Long>() {\n\n    @Override\n    public void computeFingerprint(Hasher hasher, Long value) {\n      hasher.putLong(value);\n    }\n\n    @Override\n    protected void serialize(TProtocol prot, Long value) throws TException {\n      prot.writeI64(value);\n    }\n\n    @Override\n    protected Long deserialize(TProtocol prot) throws TException {\n      return prot.readI64();","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/botmaker/src/java/com/twitter/botmaker/compiler/Serializer.java#L240-L276","documentation":"The Symbol serializer intentionally does not support strato JSON serialization: toStratoJson for Symbol values throws IllegalArgumentException. Strato JSON has no representation for Symbol-typed data, so attempting to serialize one is a programming/config error rather than a data-size or formatting issue.","triggerScenarios":"Calling the serialization path that routes through toStratoJson on a value that is a Symbol instance — e.g. serializing a rule/struct containing a Symbol field to strato JSON format.","commonSituations":"Adding a Symbol field to a struct/rule that is also emitted as strato JSON; feeding a pipeline output intended for strato storage with expression symbols still unresolved.","solutions":["Resolve/convert the Symbol to a supported primitive (e.g. its string name or extracted value) before strato serialization","Use a different serialization target for Symbol-containing data (the binary/thrift path handles more types)","If the Symbol should never reach this point, fix the upstream evaluation so symbols are substituted out first"],"exampleFix":"// before\nserializer.toStratoJson(sb, symbolValue); // throws\n\n// after\nserializer.toStratoJson(sb, symbolValue.getName()); // or resolve symbol first","handlingStrategy":"type-guard","validationCode":"// Resolve or reject Symbols before strato JSON serialization\nObject v = (value instanceof Symbol) ? ((Symbol) value).getName() : value;","typeGuard":"boolean isStratoJsonSerializable(Object v) {\n  return !(v instanceof Symbol);\n}","tryCatchPattern":"try {\n  serializer.toStratoJson(sb, value);\n} catch (IllegalArgumentException e) {\n  // fall back to string form or another serialization target\n}","preventionTips":["Resolve symbols during evaluation, not at serialization time","Keep strato-JSON-bound structs free of Symbol fields by design"],"tags":["serialization","strato-json","unsupported-type","symbol"],"backgroundTag":"unsupported-type-serialization","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}