Skip to content

Commit

Permalink
another rollback option
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Mar 24, 2024
1 parent 0596817 commit 2cacac8
Show file tree
Hide file tree
Showing 67 changed files with 1,414 additions and 1,403 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6181,19 +6181,30 @@ public String removeNonNameElementToCamelCase(String name) {
* @return camelized string
*/
protected String removeNonNameElementToCamelCase(final String name, final String nonNameElementPattern) {
String[] splitString = name.split(nonNameElementPattern);
if (Boolean.parseBoolean(System.getProperty("openapi.generator.fix.camelize"))) {
// new bebahviour with fix
String[] splitString = name.split(nonNameElementPattern);

if (splitString.length > 0) {
splitString[0] = camelize(splitString[0], CamelizeOption.LOWERCASE_FIRST_CHAR);
}
if (splitString.length > 0) {
splitString[0] = camelize(splitString[0], CamelizeOption.LOWERCASE_FIRST_CHAR);
}

String result = Arrays.stream(splitString)
.map(StringUtils::capitalize)
.collect(Collectors.joining(""));
if (result.length() > 0) {
result = result.substring(0, 1).toLowerCase(Locale.ROOT) + result.substring(1);
String result = Arrays.stream(splitString)
.map(StringUtils::capitalize)
.collect(Collectors.joining(""));
if (result.length() > 0) {
result = result.substring(0, 1).toLowerCase(Locale.ROOT) + result.substring(1);
}
return result;
} else { // old behaviour with bug
String result = Arrays.stream(name.split(nonNameElementPattern))
.map(StringUtils::capitalize)
.collect(Collectors.joining(""));
if (result.length() > 0) {
result = result.substring(0, 1).toLowerCase(Locale.ROOT) + result.substring(1);
}
return result;
}
return result;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion samples/client/echo_api/csharp-restsharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Class | Method | HTTP request | Description
*FormApi* | [**TestFormObjectMultipart**](docs/FormApi.md#testformobjectmultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
*FormApi* | [**TestFormOneof**](docs/FormApi.md#testformoneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
*HeaderApi* | [**TestHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testheaderintegerbooleanstringenums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
*PathApi* | [**TestsPathStringpathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/PathApi.md#testspathstringpathstringintegerpathintegerenumnonrefstringpathenumrefstringpath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
*PathApi* | [**TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/PathApi.md#testspathstringpathstringintegerpathintegerenumnonrefstringpathenumrefstringpath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
*QueryApi* | [**TestEnumRefString**](docs/QueryApi.md#testenumrefstring) | **GET** /query/enum_ref_string | Test query parameter(s)
*QueryApi* | [**TestQueryDatetimeDateString**](docs/QueryApi.md#testquerydatetimedatestring) | **GET** /query/datetime/date/string | Test query parameter(s)
*QueryApi* | [**TestQueryIntegerBooleanString**](docs/QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s)
Expand Down
18 changes: 9 additions & 9 deletions samples/client/echo_api/csharp-restsharp/docs/PathApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ All URIs are relative to *http://localhost:3000*

| Method | HTTP request | Description |
|--------|--------------|-------------|
| [**TestsPathStringpathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](PathApi.md#testspathstringpathstringintegerpathintegerenumnonrefstringpathenumrefstringpath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s) |
| [**TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](PathApi.md#testspathstringpathstringintegerpathintegerenumnonrefstringpathenumrefstringpath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s) |

<a id="testspathstringpathstringintegerpathintegerenumnonrefstringpathenumrefstringpath"></a>
# **TestsPathStringpathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**
> string TestsPathStringpathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath (string pathString, int pathInteger, string enumNonrefStringPath, StringEnumRef enumRefStringPath)
# **TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**
> string TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath (string pathString, int pathInteger, string enumNonrefStringPath, StringEnumRef enumRefStringPath)
Test path parameter(s)

Expand All @@ -24,7 +24,7 @@ using Org.OpenAPITools.Model;

namespace Example
{
public class TestsPathStringpathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathExample
public class TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathExample
{
public static void Main()
{
Expand All @@ -39,12 +39,12 @@ namespace Example
try
{
// Test path parameter(s)
string result = apiInstance.TestsPathStringpathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath);
string result = apiInstance.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PathApi.TestsPathStringpathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath: " + e.Message);
Debug.Print("Exception when calling PathApi.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand All @@ -53,21 +53,21 @@ namespace Example
}
```

#### Using the TestsPathStringpathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo variant
#### Using the TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.

```csharp
try
{
// Test path parameter(s)
ApiResponse<string> response = apiInstance.TestsPathStringpathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath);
ApiResponse<string> response = apiInstance.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PathApi.TestsPathStringpathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo: " + e.Message);
Debug.Print("Exception when calling PathApi.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Expand Down
Loading

0 comments on commit 2cacac8

Please sign in to comment.