Skip to content

Commit 9be3104

Browse files
committed
Handle inline scripts with both inline and source fields
1 parent 73026d1 commit 9be3104

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Nest/XPack/Watcher/Transform/ScriptTransformBase.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,17 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
7373
var inline = dict["inline"].ToString();
7474
scriptTransform = new InlineScriptTransform(inline);
7575
}
76-
if (dict.ContainsKey("file"))
76+
else if (dict.ContainsKey("source"))
77+
{
78+
var inline = dict["source"].ToString();
79+
scriptTransform = new InlineScriptTransform(inline);
80+
}
81+
else if (dict.ContainsKey("file"))
7782
{
7883
var file = dict["file"].ToString();
7984
scriptTransform = new FileScriptTransform(file);
8085
}
81-
if (dict.ContainsKey("id"))
86+
else if (dict.ContainsKey("id"))
8287
{
8388
var id = dict["id"].ToString();
8489
scriptTransform = new IndexedScriptTransform(id);

0 commit comments

Comments
 (0)