Skip to content

Commit

Permalink
JNG-5527 Fix java reserwed keywords for operations (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertcsakany authored Feb 15, 2024
1 parent 4d5b435 commit b1c995c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static String safeName(String str) {
"public", "requires", "return", "short", "static", "strictfp", "super",
"switch", "synchronized", "this", "throw", "throws", "transient", "try",
"void", "volatile", "while", "true", "null", "false", "var", "const", "goto",
"class", "Class", "int", "interface").contains(str)) {
"class", "Class", "int", "interface", "default").contains(str)) {
return str + "_";
} else {
return str;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ public interface {{ self.className }} {
public void __unbindDispatcher(hu.blackbelt.judo.dispatcher.api.Dispatcher dispatcher);
{{# each self.operations as | operation | }}

public javax.ws.rs.core.Response {{ operation.name }}(
public javax.ws.rs.core.Response {{ safeName operation.name }}(
@javax.ws.rs.core.Context javax.ws.rs.core.SecurityContext securityContext
, @javax.ws.rs.HeaderParam("X-Judo-CountRecords") java.lang.String __countRecords
{{# if operation.isBoundOperation }}
, @javax.ws.rs.HeaderParam("X-Judo-SignedIdentifier") java.lang.String __signedIdentifier
{{/ if }}
{{# if operation.input }}
{{# if operation.input.isMany }}
, java.util.List<java.util.Map<java.lang.String, java.lang.Object>> {{ operation.input.name.firstToLower }}
, java.util.List<java.util.Map<java.lang.String, java.lang.Object>> {{ safeName operation.input.name.firstToLower }}
{{ else }}
, java.util.Map<java.lang.String, java.lang.Object> {{ operation.input.name.firstToLower }}
, java.util.Map<java.lang.String, java.lang.Object> {{ safeName operation.input.name.firstToLower }}
{{/ if }}
{{/ if }}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public class {{ implClassName self }} implements {{ namedElementApiRestFqName se
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "404", description = "Not found.")
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "422", description = "Business fault")
@io.swagger.v3.oas.annotations.responses.ApiResponse(responseCode = "500", description = "Internal server error.")
public javax.ws.rs.core.Response {{ operation.name }}(
public javax.ws.rs.core.Response {{ safeName operation.name }}(
@javax.ws.rs.core.Context javax.ws.rs.core.SecurityContext securityContext, @javax.ws.rs.HeaderParam("X-Judo-CountRecords") java.lang.String __countRecords
{{# if operation.isBoundOperation }}
, @javax.ws.rs.HeaderParam("X-Judo-SignedIdentifier") java.lang.String __signedIdentifier
Expand All @@ -115,7 +115,7 @@ public class {{ implClassName self }} implements {{ namedElementApiRestFqName se
)
)
)
java.util.List<java.util.Map<java.lang.String, java.lang.Object>> {{ operation.input.name.firstToLower }}
java.util.List<java.util.Map<java.lang.String, java.lang.Object>> {{ safeName operation.input.name.firstToLower }}
{{ else }}
,
@io.swagger.v3.oas.annotations.parameters.RequestBody(
Expand All @@ -129,7 +129,7 @@ public class {{ implClassName self }} implements {{ namedElementApiRestFqName se
)
)
)
java.util.Map<java.lang.String, java.lang.Object> {{ operation.input.name.firstToLower }}
java.util.Map<java.lang.String, java.lang.Object> {{ safeName operation.input.name.firstToLower }}
{{/ if }}
{{/ if }}
) {
Expand Down

0 comments on commit b1c995c

Please sign in to comment.