Enums 避免删除公共前缀

Enums 避免删除公共前缀,enums,swagger,swagger-codegen,Enums,Swagger,Swagger Codegen,如何跳过从modelsEnum名称中删除公共前缀? 我有一个单一值的枚举(将来我会有更多值),swagger code gen plugin使用枚举代码生成类,而不是机场代码生成类 properties: type: enum: ["AIRPORT_CODE"] description: the type of location that is identified by the value 有一个添加了--use enum common prefix参数来解决这个问题,但

如何跳过从modelsEnum名称中删除公共前缀? 我有一个单一值的枚举(将来我会有更多值),swagger code gen plugin使用枚举代码生成类,而不是机场代码生成类

properties:
  type:
    enum: ["AIRPORT_CODE"]
    description: the type of location that is identified by the value
有一个添加了
--use enum common prefix
参数来解决这个问题,但它还没有合并到master中(在撰写本文时)。您可以按照问题进行更新

现在,您可以尝试在包含此PR的情况下自己重新生成swagger codegen,并使用自定义生成来生成代码。

您的问题就在这里,似乎无法在不修改该方法(或在与所需语言对应的类中重写该方法)的情况下更改此行为。您可能希望为枚举选择一种不能被
findCommonPrefixOfVars
方法捕获的格式(如果可以的话)。