1

我正在尝试使用 swagger-codegen-maven-plugin 为包含以下声明的 OpenAPI 规范生成 Java 代码:

type: object
properties:
  state:
    type: string
    enum:
      - aborted
      - finished
additionalProperties:
  type: string
required:
  - state

不知何故,生成的类缺少 state 属性,而是简单地从 HashMap 派生:

public class MyObject extends HashMap<String, String>  {

   // hasCode(), equals() and toString() methods omitted for brevity
}

有没有办法让插件生成一个实现 state 属性和动态属性的附加列表的类?

4

0 回答 0