Skip to content

Commit

Permalink
Standardize all isRestfulxxx methods. (swagger-api#7352)
Browse files Browse the repository at this point in the history
* [Scala] Fix async helper methods when body is optional (swagger-api#7274)

* [Scala] Fix async helper methods when body is optional

Closes swagger-api#7272

* Update petstore sample

* Standardize all isRestfulxxx methods.

Change 'equals' method to 'equalsIgnoreCase' for isRestfulIndex method in Operations.  This matches isRestfulCreate, isRestfulShow, isRestfulDestroy
  • Loading branch information
Five & Done authored and wing328 committed Jan 11, 2018
1 parent fb952d0 commit 148ea4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public boolean getHasExamples() {
* @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());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}})
Expand Down

0 comments on commit 148ea4f

Please sign in to comment.