From c9cdfef90426d67789bae87a93808ef6cb422824 Mon Sep 17 00:00:00 2001 From: Chloepeg Date: Tue, 30 Jun 2026 11:13:23 +0100 Subject: [PATCH 1/3] vararg port type lookup for string nodes Ensures ZeroTouch vararg nodes like String.Concat and String.Join report input and output port types correctly in the documentation browser by resolving types through DSFunctionBase and mapping expanded variadic ports back to the params parameter. Added a regression test for DSVarArgFunction port type reporting, covering String.Concat, String.Join, and an added variadic input port. --- src/DynamoCore/Graph/Nodes/PortModel.cs | 11 +++++++---- test/DynamoCoreTests/CoreTests.cs | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/DynamoCore/Graph/Nodes/PortModel.cs b/src/DynamoCore/Graph/Nodes/PortModel.cs index 481a060cd93..2e404eef09f 100644 --- a/src/DynamoCore/Graph/Nodes/PortModel.cs +++ b/src/DynamoCore/Graph/Nodes/PortModel.cs @@ -473,17 +473,19 @@ internal string GetInputPortType() { if (PortType == PortType.Output) return null; - if (Owner is DSFunction ztNode) + if (Owner is DSFunctionBase ztNode) { var fd = ztNode.Controller.Definition; string type; + var parameters = fd.Parameters.ToList(); // In the case of a node for an instance method, the first port // type is the declaring class type of the method itself. if (fd.Type == FunctionType.InstanceMethod || fd.Type == FunctionType.InstanceProperty) { if (Index > 0) { - var param = fd.Parameters.ElementAt(Index - 1); + var paramIndex = ztNode is DSVarArgFunction ? Math.Min(Index - 1, parameters.Count - 1) : Index - 1; + var param = parameters.ElementAt(paramIndex); type = param.Type.ToString(); } else @@ -493,7 +495,8 @@ internal string GetInputPortType() } else { - var param = fd.Parameters.ElementAt(Index); + var paramIndex = ztNode is DSVarArgFunction ? Math.Min(Index, parameters.Count - 1) : Index; + var param = parameters.ElementAt(paramIndex); type = param.Type.ToString(); } return type; @@ -548,7 +551,7 @@ internal string GetOutPortType() { if (PortType == PortType.Input) return null; - if (Owner is DSFunction ztNode) + if (Owner is DSFunctionBase ztNode) { var fd = ztNode.Controller.Definition; diff --git a/test/DynamoCoreTests/CoreTests.cs b/test/DynamoCoreTests/CoreTests.cs index 6b5408a9d76..16d6b7b6668 100644 --- a/test/DynamoCoreTests/CoreTests.cs +++ b/test/DynamoCoreTests/CoreTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -705,6 +705,24 @@ public void CanCopyAndPasteDSVarArgFunctionNode() }); } + [Test] + [Category("UnitTests")] + public void DSVarArgFunctionPortsReportInputAndOutputTypes() + { + var concatNode = new DSVarArgFunction(CurrentDynamoModel.LibraryServices.GetFunctionDescriptor("DSCore.String.Concat@string[]")); + + Assert.AreEqual("string[]", concatNode.InPorts[0].GetInputPortType()); + Assert.AreEqual("string", concatNode.OutPorts[0].GetOutPortType()); + + var joinNode = new DSVarArgFunction(CurrentDynamoModel.LibraryServices.GetFunctionDescriptor("DSCore.String.Join@string,string[]")); + joinNode.VarInputController.AddInputToModel(); + + Assert.AreEqual("string", joinNode.InPorts[0].GetInputPortType()); + Assert.AreEqual("string[]", joinNode.InPorts[1].GetInputPortType()); + Assert.AreEqual("string[]", joinNode.InPorts[2].GetInputPortType()); + Assert.AreEqual("string", joinNode.OutPorts[0].GetOutPortType()); + } + /// /// Pasting an Input or Output node into the Home Workspace converts them /// to a Code Block node. From 218b9c86135a1185f5be496879aa17e2a7419144 Mon Sep 17 00:00:00 2001 From: Chloepeg Date: Tue, 30 Jun 2026 16:01:55 +0100 Subject: [PATCH 2/3] Fix Curve Mapper output DataTypes in node docs Adds missing output port type metadata for Curve Mapper so the documentation browser can display double[] for both y-Values and x-Values outputs. Adds regression coverage for the two output ports --- src/Libraries/CoreNodeModels/CurveMapperNodeModel.cs | 1 + test/DynamoCoreTests/CoreTests.cs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/Libraries/CoreNodeModels/CurveMapperNodeModel.cs b/src/Libraries/CoreNodeModels/CurveMapperNodeModel.cs index 3045a1a5d82..c45728a6806 100644 --- a/src/Libraries/CoreNodeModels/CurveMapperNodeModel.cs +++ b/src/Libraries/CoreNodeModels/CurveMapperNodeModel.cs @@ -20,6 +20,7 @@ namespace CoreNodeModels [NodeSearchTags("CurveMapperSearchTags", typeof(Properties.Resources))] [InPortNames("x-MinLimit", "x-MaxLimit", "y-MinLimit", "y-MaxLimit", "values")] [InPortTypes("int", "int", "int", "int", "double")] + [OutPortTypes("double[]", "double[]")] public class CurveMapperNodeModel : NodeModel { diff --git a/test/DynamoCoreTests/CoreTests.cs b/test/DynamoCoreTests/CoreTests.cs index 16d6b7b6668..38bc3f5b6f5 100644 --- a/test/DynamoCoreTests/CoreTests.cs +++ b/test/DynamoCoreTests/CoreTests.cs @@ -723,6 +723,16 @@ public void DSVarArgFunctionPortsReportInputAndOutputTypes() Assert.AreEqual("string", joinNode.OutPorts[0].GetOutPortType()); } + [Test] + [Category("UnitTests")] + public void CurveMapperOutputsReportPortTypes() + { + var curveMapperNode = new CurveMapperNodeModel(); + + Assert.AreEqual("double[]", curveMapperNode.OutPorts[0].GetOutPortType()); + Assert.AreEqual("double[]", curveMapperNode.OutPorts[1].GetOutPortType()); + } + /// /// Pasting an Input or Output node into the Home Workspace converts them /// to a Code Block node. From 63e8a92c1d126f4a18fea78241bfc1c043319cd9 Mon Sep 17 00:00:00 2001 From: Chloepeg Date: Thu, 9 Jul 2026 11:28:26 +0100 Subject: [PATCH 3/3] Fix String output DataType in node docs Adds [OutPortTypes("string")] to StringInput so the documentation browser can show string in the output Data type column. Adds regression coverage for the String input node output port. --- src/Libraries/CoreNodeModels/Input/BaseTypes.cs | 1 + test/DynamoCoreTests/CoreTests.cs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/Libraries/CoreNodeModels/Input/BaseTypes.cs b/src/Libraries/CoreNodeModels/Input/BaseTypes.cs index c729ce70073..826b33c064a 100644 --- a/src/Libraries/CoreNodeModels/Input/BaseTypes.cs +++ b/src/Libraries/CoreNodeModels/Input/BaseTypes.cs @@ -19,6 +19,7 @@ namespace CoreNodeModels.Input [NodeName("String")] [NodeCategory(BuiltinNodeCategories.CORE_INPUT)] [NodeDescription("StringInputNodeDescription", typeof(Resources))] + [OutPortTypes("string")] [IsDesignScriptCompatible] [AlsoKnownAs("Dynamo.Nodes.StringInput", "Dynamo.Nodes.dynStringInput", "DSCoreNodesUI.Input.StringInput")] public class StringInput : String diff --git a/test/DynamoCoreTests/CoreTests.cs b/test/DynamoCoreTests/CoreTests.cs index 38bc3f5b6f5..b1cc3b162c2 100644 --- a/test/DynamoCoreTests/CoreTests.cs +++ b/test/DynamoCoreTests/CoreTests.cs @@ -733,6 +733,15 @@ public void CurveMapperOutputsReportPortTypes() Assert.AreEqual("double[]", curveMapperNode.OutPorts[1].GetOutPortType()); } + [Test] + [Category("UnitTests")] + public void StringInputOutputReportsPortType() + { + var stringNode = new StringInput(); + + Assert.AreEqual("string", stringNode.OutPorts[0].GetOutPortType()); + } + /// /// Pasting an Input or Output node into the Home Workspace converts them /// to a Code Block node.