考虑这个例子:
"allOf": [
{"$ref": "test-address-prefix-types-base.json#"},
{
"properties": {}, "additionalProperties" : false
}
]}
当我使用 Java 模式验证器对此进行验证时,我收到错误消息:
"keyword":"additionalProperties","message":"object instance has properties which are not allowed by the schema: [\"attributes\",\"type\"]"}]
但是针对基本模式(test-address-prefix-types-base)验证的同一个 JSON 对象通过而没有错误。
引用的架构(基础架构)没有设置附加属性。
这是我正在使用的 json 消息:
String message = "{\"data\":{\"attributes\":{" +
"\"notation\": \"A\"," +
"\"prefixType\": \"A\"}" +
",\"type\":\"test-address-prefix-types\"}}";
我错过了架构中的任何内容吗?谢谢