code: private static JsonStructure toJson( FunctionInputDef functionInput, String varType)
      {
      JsonObjectBuilder builder = Json.createObjectBuilder();
      toStream( functionInput.getVarDefs())
        .filter( varDef -> varDef.getType().equals( varType))
        .sorted()
        .forEach( varDef -> builder.add( varDef.getName(), toJson( varDef)));
  
      return builder.build();
      }
docs: Returns the JSON object that represents the function variables of the given type.