做网站要找什么公司/昆明seo网站管理
实现AbstractJavaCodegen(或实现它的子类)并重载postProcessOperations函数以将前缀添加到操作(CodegenOperation类的operationId属性)。有关构建和运行自定义codegen的说明,请参阅making-your-own-codegen-modules。
伪代码:
public class MyCodegen extends AbstractJavaCodegen{ \\or
[...]
@Override
public Map postProcessOperations(Map objs) {
super.postProcessOperations(objs);
Map operations = (Map) objs.get("operations");
if (operations != null) {
List ops = (List) operations.get("operation");
for (CodegenOperation operation : ops) {
if(operation.httpMethod.equals("GET"){
operation.operationId = "get_" + operation.operationId;
}[...]
}
}
return objs;
}
}