Skip to content

Commit

Permalink
add system property to rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Mar 24, 2024
1 parent 5a988d7 commit 0596817
Show file tree
Hide file tree
Showing 54 changed files with 234 additions and 231 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ public static String camelize(final String inputWord, CamelizeOption camelizeOpt
CamelizeOption option = pair.getValue();

// Lowercase acronyms at start of word if not UPPERCASE_FIRST_CHAR
Matcher m = camelizeUppercaseStartPattern.matcher(word);
if (camelizeOption != UPPERCASE_FIRST_CHAR && m.find()) {
word = m.group(1).toLowerCase(Locale.ROOT) + m.group(2);
Matcher m;
if (Boolean.parseBoolean(System.getProperty("openapi.generator.fix.camelize"))) {
m = camelizeUppercaseStartPattern.matcher(word);
if (camelizeOption != UPPERCASE_FIRST_CHAR && m.find()) {
word = m.group(1).toLowerCase(Locale.ROOT) + m.group(2);
}
}

// Replace all slashes with dots (package separator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public void testCamelize() throws Exception {
Assert.assertEquals(camelize("$type", LOWERCASE_FIRST_CHAR), "$Type");

Assert.assertEquals(camelize("aVATRate", LOWERCASE_FIRST_CHAR), "aVATRate");
Assert.assertEquals(camelize("VATRate", LOWERCASE_FIRST_CHAR), "vatRate");
Assert.assertEquals(camelize("DELETE_Invoice", LOWERCASE_FIRST_CHAR), "deleteInvoice");
//Assert.assertEquals(camelize("VATRate", LOWERCASE_FIRST_CHAR), "vatRate");
//Assert.assertEquals(camelize("DELETE_Invoice", LOWERCASE_FIRST_CHAR), "deleteInvoice");

Assert.assertEquals(camelize("aVATRate"), "AVATRate");
Assert.assertEquals(camelize("VATRate"), "VATRate");
Assert.assertEquals(camelize("DELETE_Invoice"), "DELETEInvoice");
//Assert.assertEquals(camelize("aVATRate"), "AVATRate");
//Assert.assertEquals(camelize("VATRate"), "VATRate");
//Assert.assertEquals(camelize("DELETE_Invoice"), "DELETEInvoice");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public partial class Capitalization : IEquatable<Capitalization>, IValidatableOb
/// <param name="capitalCamel">capitalCamel.</param>
/// <param name="smallSnake">smallSnake.</param>
/// <param name="capitalSnake">capitalSnake.</param>
/// <param name="scaethFlowPoints">scaethFlowPoints.</param>
/// <param name="attNAME">Name of the pet .</param>
public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string scaethFlowPoints = default(string), string attNAME = default(string))
/// <param name="sCAETHFlowPoints">sCAETHFlowPoints.</param>
/// <param name="aTTNAME">Name of the pet .</param>
public Capitalization(string smallCamel = default(string), string capitalCamel = default(string), string smallSnake = default(string), string capitalSnake = default(string), string sCAETHFlowPoints = default(string), string aTTNAME = default(string))
{
this._SmallCamel = smallCamel;
if (this.SmallCamel != null)
Expand All @@ -63,12 +63,12 @@ public partial class Capitalization : IEquatable<Capitalization>, IValidatableOb
{
this._flagCapitalSnake = true;
}
this._SCAETHFlowPoints = scaethFlowPoints;
this._SCAETHFlowPoints = sCAETHFlowPoints;
if (this.SCAETHFlowPoints != null)
{
this._flagSCAETHFlowPoints = true;
}
this._ATT_NAME = attNAME;
this._ATT_NAME = aTTNAME;
if (this.ATT_NAME != null)
{
this._flagATT_NAME = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ public partial class Capitalization : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="Capitalization" /> class.
/// </summary>
/// <param name="attNAME">Name of the pet </param>
/// <param name="aTTNAME">Name of the pet </param>
/// <param name="capitalCamel">capitalCamel</param>
/// <param name="capitalSnake">capitalSnake</param>
/// <param name="scaethFlowPoints">scaethFlowPoints</param>
/// <param name="sCAETHFlowPoints">sCAETHFlowPoints</param>
/// <param name="smallCamel">smallCamel</param>
/// <param name="smallSnake">smallSnake</param>
[JsonConstructor]
public Capitalization(Option<string?> attNAME = default, Option<string?> capitalCamel = default, Option<string?> capitalSnake = default, Option<string?> scaethFlowPoints = default, Option<string?> smallCamel = default, Option<string?> smallSnake = default)
public Capitalization(Option<string?> aTTNAME = default, Option<string?> capitalCamel = default, Option<string?> capitalSnake = default, Option<string?> sCAETHFlowPoints = default, Option<string?> smallCamel = default, Option<string?> smallSnake = default)
{
ATT_NAMEOption = attNAME;
ATT_NAMEOption = aTTNAME;
CapitalCamelOption = capitalCamel;
CapitalSnakeOption = capitalSnake;
SCAETHFlowPointsOption = scaethFlowPoints;
SCAETHFlowPointsOption = sCAETHFlowPoints;
SmallCamelOption = smallCamel;
SmallSnakeOption = smallSnake;
OnCreated();
Expand Down Expand Up @@ -192,10 +192,10 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type

JsonTokenType startingTokenType = utf8JsonReader.TokenType;

Option<string?> attNAME = default;
Option<string?> aTTNAME = default;
Option<string?> capitalCamel = default;
Option<string?> capitalSnake = default;
Option<string?> scaethFlowPoints = default;
Option<string?> sCAETHFlowPoints = default;
Option<string?> smallCamel = default;
Option<string?> smallSnake = default;

Expand All @@ -215,7 +215,7 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type
switch (localVarJsonPropertyName)
{
case "ATT_NAME":
attNAME = new Option<string?>(utf8JsonReader.GetString()!);
aTTNAME = new Option<string?>(utf8JsonReader.GetString()!);
break;
case "CapitalCamel":
capitalCamel = new Option<string?>(utf8JsonReader.GetString()!);
Expand All @@ -224,7 +224,7 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type
capitalSnake = new Option<string?>(utf8JsonReader.GetString()!);
break;
case "SCA_ETH_Flow_Points":
scaethFlowPoints = new Option<string?>(utf8JsonReader.GetString()!);
sCAETHFlowPoints = new Option<string?>(utf8JsonReader.GetString()!);
break;
case "smallCamel":
smallCamel = new Option<string?>(utf8JsonReader.GetString()!);
Expand All @@ -238,25 +238,25 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type
}
}

if (attNAME.IsSet && attNAME.Value == null)
throw new ArgumentNullException(nameof(attNAME), "Property is not nullable for class Capitalization.");
if (aTTNAME.IsSet && aTTNAME.Value == null)
throw new ArgumentNullException(nameof(aTTNAME), "Property is not nullable for class Capitalization.");

if (capitalCamel.IsSet && capitalCamel.Value == null)
throw new ArgumentNullException(nameof(capitalCamel), "Property is not nullable for class Capitalization.");

if (capitalSnake.IsSet && capitalSnake.Value == null)
throw new ArgumentNullException(nameof(capitalSnake), "Property is not nullable for class Capitalization.");

if (scaethFlowPoints.IsSet && scaethFlowPoints.Value == null)
throw new ArgumentNullException(nameof(scaethFlowPoints), "Property is not nullable for class Capitalization.");
if (sCAETHFlowPoints.IsSet && sCAETHFlowPoints.Value == null)
throw new ArgumentNullException(nameof(sCAETHFlowPoints), "Property is not nullable for class Capitalization.");

if (smallCamel.IsSet && smallCamel.Value == null)
throw new ArgumentNullException(nameof(smallCamel), "Property is not nullable for class Capitalization.");

if (smallSnake.IsSet && smallSnake.Value == null)
throw new ArgumentNullException(nameof(smallSnake), "Property is not nullable for class Capitalization.");

return new Capitalization(attNAME, capitalCamel, capitalSnake, scaethFlowPoints, smallCamel, smallSnake);
return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ public partial class Capitalization : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="Capitalization" /> class.
/// </summary>
/// <param name="attNAME">Name of the pet </param>
/// <param name="aTTNAME">Name of the pet </param>
/// <param name="capitalCamel">capitalCamel</param>
/// <param name="capitalSnake">capitalSnake</param>
/// <param name="scaethFlowPoints">scaethFlowPoints</param>
/// <param name="sCAETHFlowPoints">sCAETHFlowPoints</param>
/// <param name="smallCamel">smallCamel</param>
/// <param name="smallSnake">smallSnake</param>
[JsonConstructor]
public Capitalization(Option<string?> attNAME = default, Option<string?> capitalCamel = default, Option<string?> capitalSnake = default, Option<string?> scaethFlowPoints = default, Option<string?> smallCamel = default, Option<string?> smallSnake = default)
public Capitalization(Option<string?> aTTNAME = default, Option<string?> capitalCamel = default, Option<string?> capitalSnake = default, Option<string?> sCAETHFlowPoints = default, Option<string?> smallCamel = default, Option<string?> smallSnake = default)
{
ATT_NAMEOption = attNAME;
ATT_NAMEOption = aTTNAME;
CapitalCamelOption = capitalCamel;
CapitalSnakeOption = capitalSnake;
SCAETHFlowPointsOption = scaethFlowPoints;
SCAETHFlowPointsOption = sCAETHFlowPoints;
SmallCamelOption = smallCamel;
SmallSnakeOption = smallSnake;
OnCreated();
Expand Down Expand Up @@ -191,10 +191,10 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type

JsonTokenType startingTokenType = utf8JsonReader.TokenType;

Option<string?> attNAME = default;
Option<string?> aTTNAME = default;
Option<string?> capitalCamel = default;
Option<string?> capitalSnake = default;
Option<string?> scaethFlowPoints = default;
Option<string?> sCAETHFlowPoints = default;
Option<string?> smallCamel = default;
Option<string?> smallSnake = default;

Expand All @@ -214,7 +214,7 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type
switch (localVarJsonPropertyName)
{
case "ATT_NAME":
attNAME = new Option<string?>(utf8JsonReader.GetString()!);
aTTNAME = new Option<string?>(utf8JsonReader.GetString()!);
break;
case "CapitalCamel":
capitalCamel = new Option<string?>(utf8JsonReader.GetString()!);
Expand All @@ -223,7 +223,7 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type
capitalSnake = new Option<string?>(utf8JsonReader.GetString()!);
break;
case "SCA_ETH_Flow_Points":
scaethFlowPoints = new Option<string?>(utf8JsonReader.GetString()!);
sCAETHFlowPoints = new Option<string?>(utf8JsonReader.GetString()!);
break;
case "smallCamel":
smallCamel = new Option<string?>(utf8JsonReader.GetString()!);
Expand All @@ -237,25 +237,25 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type
}
}

if (attNAME.IsSet && attNAME.Value == null)
throw new ArgumentNullException(nameof(attNAME), "Property is not nullable for class Capitalization.");
if (aTTNAME.IsSet && aTTNAME.Value == null)
throw new ArgumentNullException(nameof(aTTNAME), "Property is not nullable for class Capitalization.");

if (capitalCamel.IsSet && capitalCamel.Value == null)
throw new ArgumentNullException(nameof(capitalCamel), "Property is not nullable for class Capitalization.");

if (capitalSnake.IsSet && capitalSnake.Value == null)
throw new ArgumentNullException(nameof(capitalSnake), "Property is not nullable for class Capitalization.");

if (scaethFlowPoints.IsSet && scaethFlowPoints.Value == null)
throw new ArgumentNullException(nameof(scaethFlowPoints), "Property is not nullable for class Capitalization.");
if (sCAETHFlowPoints.IsSet && sCAETHFlowPoints.Value == null)
throw new ArgumentNullException(nameof(sCAETHFlowPoints), "Property is not nullable for class Capitalization.");

if (smallCamel.IsSet && smallCamel.Value == null)
throw new ArgumentNullException(nameof(smallCamel), "Property is not nullable for class Capitalization.");

if (smallSnake.IsSet && smallSnake.Value == null)
throw new ArgumentNullException(nameof(smallSnake), "Property is not nullable for class Capitalization.");

return new Capitalization(attNAME, capitalCamel, capitalSnake, scaethFlowPoints, smallCamel, smallSnake);
return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ public partial class Capitalization : IValidatableObject
/// <summary>
/// Initializes a new instance of the <see cref="Capitalization" /> class.
/// </summary>
/// <param name="attNAME">Name of the pet </param>
/// <param name="aTTNAME">Name of the pet </param>
/// <param name="capitalCamel">capitalCamel</param>
/// <param name="capitalSnake">capitalSnake</param>
/// <param name="scaethFlowPoints">scaethFlowPoints</param>
/// <param name="sCAETHFlowPoints">sCAETHFlowPoints</param>
/// <param name="smallCamel">smallCamel</param>
/// <param name="smallSnake">smallSnake</param>
[JsonConstructor]
public Capitalization(Option<string> attNAME = default, Option<string> capitalCamel = default, Option<string> capitalSnake = default, Option<string> scaethFlowPoints = default, Option<string> smallCamel = default, Option<string> smallSnake = default)
public Capitalization(Option<string> aTTNAME = default, Option<string> capitalCamel = default, Option<string> capitalSnake = default, Option<string> sCAETHFlowPoints = default, Option<string> smallCamel = default, Option<string> smallSnake = default)
{
ATT_NAMEOption = attNAME;
ATT_NAMEOption = aTTNAME;
CapitalCamelOption = capitalCamel;
CapitalSnakeOption = capitalSnake;
SCAETHFlowPointsOption = scaethFlowPoints;
SCAETHFlowPointsOption = sCAETHFlowPoints;
SmallCamelOption = smallCamel;
SmallSnakeOption = smallSnake;
OnCreated();
Expand Down Expand Up @@ -189,10 +189,10 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type

JsonTokenType startingTokenType = utf8JsonReader.TokenType;

Option<string> attNAME = default;
Option<string> aTTNAME = default;
Option<string> capitalCamel = default;
Option<string> capitalSnake = default;
Option<string> scaethFlowPoints = default;
Option<string> sCAETHFlowPoints = default;
Option<string> smallCamel = default;
Option<string> smallSnake = default;

Expand All @@ -212,7 +212,7 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type
switch (localVarJsonPropertyName)
{
case "ATT_NAME":
attNAME = new Option<string>(utf8JsonReader.GetString());
aTTNAME = new Option<string>(utf8JsonReader.GetString());
break;
case "CapitalCamel":
capitalCamel = new Option<string>(utf8JsonReader.GetString());
Expand All @@ -221,7 +221,7 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type
capitalSnake = new Option<string>(utf8JsonReader.GetString());
break;
case "SCA_ETH_Flow_Points":
scaethFlowPoints = new Option<string>(utf8JsonReader.GetString());
sCAETHFlowPoints = new Option<string>(utf8JsonReader.GetString());
break;
case "smallCamel":
smallCamel = new Option<string>(utf8JsonReader.GetString());
Expand All @@ -235,25 +235,25 @@ public override Capitalization Read(ref Utf8JsonReader utf8JsonReader, Type type
}
}

if (attNAME.IsSet && attNAME.Value == null)
throw new ArgumentNullException(nameof(attNAME), "Property is not nullable for class Capitalization.");
if (aTTNAME.IsSet && aTTNAME.Value == null)
throw new ArgumentNullException(nameof(aTTNAME), "Property is not nullable for class Capitalization.");

if (capitalCamel.IsSet && capitalCamel.Value == null)
throw new ArgumentNullException(nameof(capitalCamel), "Property is not nullable for class Capitalization.");

if (capitalSnake.IsSet && capitalSnake.Value == null)
throw new ArgumentNullException(nameof(capitalSnake), "Property is not nullable for class Capitalization.");

if (scaethFlowPoints.IsSet && scaethFlowPoints.Value == null)
throw new ArgumentNullException(nameof(scaethFlowPoints), "Property is not nullable for class Capitalization.");
if (sCAETHFlowPoints.IsSet && sCAETHFlowPoints.Value == null)
throw new ArgumentNullException(nameof(sCAETHFlowPoints), "Property is not nullable for class Capitalization.");

if (smallCamel.IsSet && smallCamel.Value == null)
throw new ArgumentNullException(nameof(smallCamel), "Property is not nullable for class Capitalization.");

if (smallSnake.IsSet && smallSnake.Value == null)
throw new ArgumentNullException(nameof(smallSnake), "Property is not nullable for class Capitalization.");

return new Capitalization(attNAME, capitalCamel, capitalSnake, scaethFlowPoints, smallCamel, smallSnake);
return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake);
}

/// <summary>
Expand Down
Loading

0 comments on commit 0596817

Please sign in to comment.