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)
This commit is contained in:
Duane Johnson 2013-09-18 15:47:41 -06:00
parent 13bc111bd6
commit 7956ccc979

View File

@ -362,6 +362,7 @@ class Codegen(config: CodegenConfig) {
"requiredParams" -> requiredParams.toList,
"errorList" -> errorList,
"httpMethod" -> operation.method.toUpperCase,
"httpMethodLowerCase" -> operation.method.toLowerCase,
operation.method.toLowerCase -> "true")
if (requiredParams.size > 0) properties += "requiredParamCount" -> requiredParams.size.toString
operation.responseClass.indexOf("[") match {