forked from loafle/openapi-generator-original
Standardize all isRestfulxxx methods. (#7352)
* [Scala] Fix async helper methods when body is optional (#7274) * [Scala] Fix async helper methods when body is optional Closes #7272 * Update petstore sample * Standardize all isRestfulxxx methods. Change 'equals' method to 'equalsIgnoreCase' for isRestfulIndex method in Operations. This matches isRestfulCreate, isRestfulShow, isRestfulDestroy
This commit is contained in:
committed by
William Cheng
parent
ebf4efe3ea
commit
1bb9207c9b
@@ -111,7 +111,7 @@ public class CodegenOperation {
|
||||
* @return true if act as Restful index method, false otherwise
|
||||
*/
|
||||
public boolean isRestfulIndex() {
|
||||
return "GET".equals(httpMethod) && "".equals(pathWithoutBaseName());
|
||||
return "GET".equalsIgnoreCase(httpMethod) && "".equals(pathWithoutBaseName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -95,7 +95,7 @@ class {{classname}}AsyncHelper(client: TransportClient, config: SwaggerConfig) e
|
||||
{{#operation}}
|
||||
def {{operationId}}({{#allParams}}{{^required}}{{paramName}}: Option[{{dataType}}] = {{#defaultValue}}Some({{defaultValue}}){{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{#hasMore}},{{/hasMore}}
|
||||
{{/required}}{{#required}}{{paramName}}: {{dataType}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#hasMore}},
|
||||
{{/hasMore}}{{/required}}{{/allParams}})(implicit reader: ClientResponseReader[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]{{#bodyParams}}, writer: RequestWriter[{{dataType}}]{{/bodyParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}}{{^returnType}}: Future[Unit]{{/returnType}} = {
|
||||
{{/hasMore}}{{/required}}{{/allParams}})(implicit reader: ClientResponseReader[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}]{{#bodyParams}}, writer: RequestWriter[{{^required}}Option[{{dataType}}]{{/required}}{{#required}}{{dataType}}{{/required}}]{{/bodyParams}}){{#returnType}}: Future[{{returnType}}]{{/returnType}}{{^returnType}}: Future[Unit]{{/returnType}} = {
|
||||
// create path and map variables
|
||||
val path = (addFmt("{{path}}"){{#pathParams}}
|
||||
replaceAll("\\{" + "{{baseName}}" + "\\}", {{paramName}}.toString){{/pathParams}})
|
||||
|
||||
Reference in New Issue
Block a user