Skip to content

Commit 7956ccc

Browse files
author
Duane Johnson
committed
Add an 'httpMethodLowerCase' property
Some libraries use lower case httpMethod names for method calls. For example, Ruby's Faraday library uses 'get', 'put', 'post', 'delete'. Rather than this unweildy Ruby code produced by a mustache template: self.send("GET".downcase, path, request_opts) This patch would allow for a more tidy output such as: get(path, request_opts)
1 parent 13bc111 commit 7956ccc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/scala/com/wordnik/swagger/codegen/Codegen.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ class Codegen(config: CodegenConfig) {
362362
"requiredParams" -> requiredParams.toList,
363363
"errorList" -> errorList,
364364
"httpMethod" -> operation.method.toUpperCase,
365+
"httpMethodLowerCase" -> operation.method.toLowerCase,
365366
operation.method.toLowerCase -> "true")
366367
if (requiredParams.size > 0) properties += "requiredParamCount" -> requiredParams.size.toString
367368
operation.responseClass.indexOf("[") match {

0 commit comments

Comments
 (0)