@@ -385,14 +385,30 @@ class Codegen(config: CodegenConfig) {
385
385
" httpMethodLowerCase" -> operation.method.toLowerCase,
386
386
operation.method.toLowerCase -> " true" )
387
387
if (0 < operation.consumes.length) {
388
- properties += " consume" -> operation.consumes(0 )
388
+ val m = new HashMap [String , String ]
389
+ val o = new ListBuffer [Map [String , String ]]
390
+ for (i <- 0 until operation.consumes.length) {
391
+ if (i < operation.consumes.length - 1 )
392
+ m += " hasMore" -> " true"
393
+ m += " mediaType" -> operation.consumes(i)
394
+ o += m.toMap
395
+ }
396
+ properties += " consumes" -> o.toList
389
397
} else {
390
- properties += " consume " -> " application/json"
398
+ properties += " consumes " -> List ( Map ( " mediaType " -> " application/json" ))
391
399
}
392
400
if (0 < operation.produces.length) {
393
- properties += " produces" -> operation.produces
401
+ val m = new HashMap [String , String ]
402
+ val o = new ListBuffer [Map [String , String ]]
403
+ for (i <- 0 until operation.produces.length) {
404
+ if (i < operation.produces.length - 1 )
405
+ m += " hasMore" -> " true"
406
+ m += " mediaType" -> operation.produces(i)
407
+ o += m.toMap
408
+ }
409
+ properties += " produces" -> o.toList
394
410
} else {
395
- properties += " produces" -> " application/json"
411
+ properties += " produces" -> List ( Map ( " mediaType " -> " application/json" ))
396
412
}
397
413
if (requiredParams.size > 0 ) properties += " requiredParamCount" -> requiredParams.size.toString
398
414
operation.responseClass.indexOf(" [" ) match {
0 commit comments