Skip to content

Commit d714965

Browse files
committed
fix names
1 parent 41e32bc commit d714965

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.generator/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
format_data_with_schema,
2525
get_response_type,
2626
upperfirst,
27-
escape_method_reserved_names,
27+
escape_method_reserved_name,
2828
)
2929

3030

@@ -76,7 +76,7 @@ def lookup(value, path):
7676
JINJA_ENV.globals["format_parameters"] = format_parameters
7777
JINJA_ENV.globals["get_response_type"] = get_response_type
7878
JINJA_ENV.globals["get_type_at_path"] = openapi.get_type_at_path
79-
JINJA_ENV.filters["escape_method_reserved_names"] = escape_method_reserved_names
79+
JINJA_ENV.filters["escape_method_reserved_name"] = escape_method_reserved_name
8080

8181
JAVA_EXAMPLE_J2 = JINJA_ENV.get_template("example.j2")
8282

.generator/src/generator/formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def untitle_case(value):
131131
def upperfirst(value):
132132
return value[0].upper() + value[1:]
133133

134-
def escape_method_reserved_names(method_name):
134+
def escape_method_reserved_name(method_name):
135135
"""
136136
Escape reserved language keywords for method names like getClass, setClass, isClass, etc.
137137
"""

.generator/src/generator/templates/modelSimple.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public class {{ name }} {%- if model.get("x-generate-alias-as-model") %} extends
216216
{%- if schema.additionalProperties is defined and schema.additionalProperties is not false %}{%- if schema.additionalProperties.nullable %}content = JsonInclude.Include.ALWAYS,{%- endif %}{%- endif %}
217217
value = JsonInclude.Include.{%- if isRequired %}ALWAYS{%- else %}USE_DEFAULTS{%- endif %})
218218
{%- endif %}
219-
public {{ dataType }} get{{ attr|camel_case|upperfirst|escape_reserved_keyword }}() {
219+
public {{ dataType }} get{{ attr|camel_case|upperfirst|escape_method_reserved_name }}() {
220220
{%- if not isRequired and isNullable %}
221221
{%- if schema.get("readOnly", False) %}
222222

@@ -247,7 +247,7 @@ public class {{ name }} {%- if model.get("x-generate-alias-as-model") %} extends
247247
{%- endif %}
248248

249249
{%- if not schema.get("readOnly", False) %}
250-
public void set{{ attr|camel_case|upperfirst|escape_reserved_keyword }}({{ dataType }} {{ variableName }}) {
250+
public void set{{ attr|camel_case|upperfirst|escape_method_reserved_name }}({{ dataType }} {{ variableName }}) {
251251
{%- if schema.enum is defined %}
252252
if (!{{ variableName }}.isValid()) {
253253
this.unparsed = true;

0 commit comments

Comments
 (0)