Skip to content

Commit 4d804f5

Browse files
committed
fixed restful methods names in order to fix missing parameters issue.
1 parent e25eda6 commit 4d804f5

File tree

1 file changed

+8
-32
lines changed

1 file changed

+8
-32
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/v3/CodegenOperation.java

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public boolean getHasExamples() {
108108
*
109109
* @return true if act as Restful index method, false otherwise
110110
*/
111-
public boolean isRestfulIndex() {
111+
public boolean getIsRestfulIndex() {
112112
return "GET".equals(httpMethod) && "".equals(pathWithoutBaseName());
113113
}
114114

@@ -117,7 +117,7 @@ public boolean isRestfulIndex() {
117117
*
118118
* @return true if act as Restful show method, false otherwise
119119
*/
120-
public boolean isRestfulShow() {
120+
public boolean getIsRestfulShow() {
121121
return "GET".equalsIgnoreCase(httpMethod) && isMemberPath();
122122
}
123123

@@ -126,7 +126,7 @@ public boolean isRestfulShow() {
126126
*
127127
* @return true if act as Restful create method, false otherwise
128128
*/
129-
public boolean isRestfulCreate() {
129+
public boolean getIsRestfulCreate() {
130130
return "POST".equalsIgnoreCase(httpMethod) && "".equals(pathWithoutBaseName());
131131
}
132132

@@ -135,7 +135,7 @@ public boolean isRestfulCreate() {
135135
*
136136
* @return true if act as Restful update method, false otherwise
137137
*/
138-
public boolean isRestfulUpdate() {
138+
public boolean getIsRestfulUpdate() {
139139
return Arrays.asList("PUT", "PATCH").contains(httpMethod.toUpperCase()) && isMemberPath();
140140
}
141141

@@ -144,7 +144,7 @@ public boolean isRestfulUpdate() {
144144
*
145145
* @return true request method is PUT, PATCH or POST; false otherwise
146146
*/
147-
public boolean isBodyAllowed() {
147+
public boolean getIsBodyAllowed() {
148148
return Arrays.asList("PUT", "PATCH", "POST").contains(httpMethod.toUpperCase());
149149
}
150150

@@ -153,7 +153,7 @@ public boolean isBodyAllowed() {
153153
*
154154
* @return true if act as Restful destroy method, false otherwise
155155
*/
156-
public boolean isRestfulDestroy() {
156+
public boolean getIsRestfulDestroy() {
157157
return "DELETE".equalsIgnoreCase(httpMethod) && isMemberPath();
158158
}
159159

@@ -162,8 +162,8 @@ public boolean isRestfulDestroy() {
162162
*
163163
* @return true if Restful-style, false otherwise
164164
*/
165-
public boolean isRestful() {
166-
return isRestfulIndex() || isRestfulShow() || isRestfulCreate() || isRestfulUpdate() || isRestfulDestroy();
165+
public boolean getIsRestful() {
166+
return getIsRestfulIndex() || getIsRestfulShow() || getIsRestfulCreate() || getIsRestfulUpdate() || getIsRestfulDestroy();
167167
}
168168

169169
/**
@@ -467,30 +467,6 @@ public String getOperationIdSnakeCase() {
467467
return operationIdSnakeCase;
468468
}
469469

470-
public Boolean getIsRestfulIndex() {
471-
return getBooleanValue(CodegenConstants.IS_RESTFUL_INDEX_EXT_NAME);
472-
}
473-
474-
public Boolean getIsRestfulShow() {
475-
return getBooleanValue(CodegenConstants.IS_RESTFUL_SHOW_EXT_NAME);
476-
}
477-
478-
public Boolean getIsRestfulCreate() {
479-
return getBooleanValue(CodegenConstants.IS_RESTFUL_CREATE_EXT_NAME);
480-
}
481-
482-
public Boolean getIsRestfulUpdate() {
483-
return getBooleanValue(CodegenConstants.IS_RESTFUL_UPDATE_EXT_NAME);
484-
}
485-
486-
public Boolean getIsRestfulDestroy() {
487-
return getBooleanValue(CodegenConstants.IS_RESTFUL_DESTROY_EXT_NAME);
488-
}
489-
490-
public Boolean getIsRestful() {
491-
return getBooleanValue(CodegenConstants.IS_RESTFUL_EXT_NAME);
492-
}
493-
494470
public Boolean getIsDeprecated() {
495471
return getBooleanValue(CodegenConstants.IS_DEPRECATED_EXT_NAME);
496472
}

0 commit comments

Comments
 (0)