简体   繁体   English

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

[英]Swagger Codegen - How to identify whether a property is nullable or not?

{
  "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": {}
}

Above is the format swagger-codegen-cli will accept but according to this there is no variable to identify whether the property should be nullable or not. 上面是swagger-codegen-cli将接受的格式,但是根据格式,没有变量来标识该属性是否应该为空。 Is there anyway to workaround this? 反正有解决方法吗?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM