1
{
    "type" : "object",
    "properties" : {
        "street_address" : {
            "type" : "string"
        },
        "city" : {
            "type" : "string"
        },
        "state" : {
            "type" : "string"
        }
    },
    "oneOf" : [{
            "required" : ["city"]
        }, {
            "required" : ["state"]
        }
    ],
    "required" : [
        "street_address"
    ],
    "additionalProperties" : false
}

这个 json 模式的 Java 类是什么?当我生成类时,类中没有像街道地址这样的属性

4

1 回答 1

-1
class One{
String streetAddress;
String city;
String state;

// put getters and setters for each of the member variables.

}

我希望,您的查询将解决:)

于 2016-10-14T05:48:18.107 回答