use default value of parameter if available

This commit is contained in:
Pilzinsel64
2025-08-08 09:11:05 +02:00
parent 8078e41ed4
commit d51647a4b5
2 changed files with 3 additions and 1 deletions

View File

@@ -551,6 +551,8 @@ public class ApiServer : IApiServer
objs.Add(Convert.ChangeType(HttpUtility.UrlDecode(parameterValue), info.ParameterType)); // or Uri.UnescapeDataString(); maybe run this line twice?
else if (queryparams.AllKeys.FirstOrDefault(n => n != null && n.Equals(info.Name, StringComparison.InvariantCultureIgnoreCase)) is string querykey)
objs.Add(Convert.ChangeType(HttpUtility.UrlDecode(queryparams.Get(querykey)), info.ParameterType));
else if (info.HasDefaultValue)
objs.Add(info.DefaultValue);
else
objs.Add(null);
}

View File

@@ -8,7 +8,7 @@
</PropertyGroup>
<PropertyGroup>
<Version>2.6.8</Version>
<Version>2.6.9</Version>
</PropertyGroup>
<ItemGroup>