JSon schema and Inheritance

后端 未结 3 827
逝去的感伤
逝去的感伤 2020-12-18 19:28

I have searched on json schema with java bindings with inheritance and all searches led me to the usage of \"allOf\".

Using allOf would potentially solve my problem

3条回答
  •  执念已碎
    2020-12-18 19:51

    you have 3 options, I am using jsonschema2pojo : 1.0.0-alpha2

    "extends": {
        "$ref": "MyObject.json"
    }
    

    or

    "extends": {
        "type": "object",
        "javaType": "com.mycompany.model.MyObject"
    }
    

    or

     "extendsJavaClass" : "com.mycompany.model.MyObject"
    

提交回复
热议问题