forked from loafle/openapi-generator-original
Replace maps with models to reduce casting (#11913)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
package com.my.company.codegen
|
||||
|
||||
import org.openapitools.codegen.*
|
||||
import org.openapitools.codegen.model.ModelMap;
|
||||
|
||||
import java.util.*
|
||||
import java.io.File
|
||||
@@ -36,7 +37,7 @@ open class MyclientcodegenGenerator() : DefaultCodegen(), CodegenConfig {
|
||||
* Provides an opportunity to inspect and modify operation data before the code is generated.
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
override fun postProcessOperationsWithModels(objs: Map<String, Any>, allModels: List<Any>?): Map<String, Any> {
|
||||
override fun postProcessOperationsWithModels(objs: Map<String, Any>, allModels: List<ModelMap>?): Map<String, Any> {
|
||||
val results = super.postProcessOperationsWithModels(objs, allModels)
|
||||
|
||||
val ops = results["operations"] as Map<String, Any>
|
||||
@@ -180,4 +181,4 @@ open class MyclientcodegenGenerator() : DefaultCodegen(), CodegenConfig {
|
||||
//TODO: check that this logic is safe to escape quotation mark to avoid code injection
|
||||
return with(input) { replace("\"", "\\\"") }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user