Skip to content

Commit

Permalink
fix csharp naming conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
tg123 committed Apr 27, 2024
1 parent 22e4b70 commit f61c1da
Showing 1 changed file with 38 additions and 44 deletions.
82 changes: 38 additions & 44 deletions src/LibKubernetesGenerator/GeneralNameHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,57 +78,51 @@ public string GetDotNetName(string jsonName, string style = "parameter")
switch (style)
{
case "parameter":
if (jsonName == "namespace")
switch (jsonName)
{
return "namespaceParameter";
}
else if (jsonName == "continue")
{
return "continueParameter";
case "namespace":
return "namespaceParameter";
case "continue":
return "continueParameter";
default:
break;
}

break;

case "fieldctor":
if (jsonName == "namespace")
{
return "namespaceProperty";
}
else if (jsonName == "continue")
{
return "continueProperty";
}
else if (jsonName == "$ref")
{
return "refProperty";
}
else if (jsonName == "default")
{
return "defaultProperty";
}
else if (jsonName == "operator")
{
return "operatorProperty";
}
else if (jsonName == "$schema")
{
return "schema";
}
else if (jsonName == "enum")
{
return "enumProperty";
}
else if (jsonName == "object")
{
return "objectProperty";
}
else if (jsonName == "readOnly")
{
return "readOnlyProperty";
}
else if (jsonName == "from")

switch (jsonName)
{
return "fromProperty";
case "namespace":
return "namespaceProperty";
case "continue":
return "continueProperty";
case "$ref":
return "refProperty";
case "default":
return "defaultProperty";
case "operator":
return "operatorProperty";
case "$schema":
return "schema";
case "enum":
return "enumProperty";
case "object":
return "objectProperty";
case "readOnly":
return "readOnlyProperty";
case "from":
return "fromProperty";
case "int":
return "intValue";
case "bool":
return "boolValue";
case "string":
return "stringValue";

default:
break;
}

if (jsonName.Contains("-"))
Expand Down

0 comments on commit f61c1da

Please sign in to comment.