Check if enum_values exists in the serverUrl [csharp] (#21122)

* check if enum_values are existing

If no enum_values are given for in a serverUrl, the check must be ignored.

* update samples

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
Kai-Uwe Hüber
2025-04-23 10:26:41 +02:00
committed by GitHub
parent d589f5db11
commit 28daa68943
18 changed files with 18 additions and 18 deletions

View File

@@ -503,7 +503,7 @@ namespace Org.OpenAPITools.Client
if (inputVariables.ContainsKey(variable.Key))
{
if (((List<string>)serverVariables["enum_values"]).Contains(inputVariables[variable.Key]))
if (!serverVariables.ContainsKey("enum_values") || ((List<string>)serverVariables["enum_values"]).Contains(inputVariables[variable.Key]))
{
url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]);
}