Skip to content

Commit

Permalink
Fix kotlin java method name escape
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Jun 18, 2024
1 parent 2bd3eb2 commit 1106522
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {
{%~ if method.parameters.all | reduce((carry, param) => carry or not param.required) %}
@JvmOverloads
{%~ endif %}
suspend fun {% if method.responseModel | hasGenericType(spec) %}{{ '<T>' | raw }} {% endif %}{{ method.name | caseCamel }}(
suspend fun {% if method.responseModel | hasGenericType(spec) %}{{ '<T>' | raw }} {% endif %}{{ method.name | caseCamel | escapeKeyword }}(
{%~ if method.type == "webAuth" %}
activity: ComponentActivity,
{%~ endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class {{ service.name | caseUcfirst }}(client: Client) : Service(client) {
@JvmOverloads
{%~ endif %}
@Throws({{ spec.title | caseUcfirst }}Exception::class)
suspend fun {% if method.responseModel | hasGenericType(spec) %}{{ '<T>' | raw }} {% endif %}{{ method.name | caseCamel }}(
suspend fun {% if method.responseModel | hasGenericType(spec) %}{{ '<T>' | raw }} {% endif %}{{ method.name | caseCamel | escapeKeyword }}(
{%~ for parameter in method.parameters.all %}
{{ parameter.name | caseCamel }}: {{ parameter | typeName }}{%~ if not parameter.required or parameter.nullable %}? = null{% endif %},
{%~ endfor %}
Expand Down
2 changes: 1 addition & 1 deletion tests/languages/android/Tests.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void test() throws IOException {
writeToFile(ex.toString());
}

general.enum(MockType.FIRST, new CoroutineCallback<>(this::writeMockResult));
general.xenum(MockType.FIRST, new CoroutineCallback<>(this::writeMockResult));

try {
general.error400();
Expand Down
2 changes: 1 addition & 1 deletion tests/languages/android/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class ServiceTest {
writeToFile(ex.toString())
}

mock = general.enum(MockType.FIRST)
mock = general.xenum(MockType.FIRST)
writeToFile(mock.result)

try {
Expand Down

0 comments on commit 1106522

Please sign in to comment.