mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-05 22:46:09 +00:00
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:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user