Swagger Codegen-如何识别属性是否可为空?

时间:2018-08-02 08:33:30

标签: java swagger swagger-codegen

{
  "swagger": "2.0",
  "info": {
    "title": "Business Objects",
    "version": "1.0"
  },
  "host": "NA",
  "definitions": {
    "Customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "isActive": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "name",
        "isActive"
      ]
    }
  },
  "paths": {}
}

以上是swagger-codegen-cli可接受的格式,但是根据this,没有变量来标识该属性是否应该为空。反正有解决方法吗?

1 个答案:

答案 0 :(得分:0)

不得不求助于自己对程序进行更改,现在我们在构建中使用了修改后的版本。