We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
schema 的 allOf 无效
请填写以下信息:
根据schema教程
https://tour.json-schema.org/content/06-Combining-Subschemas/03-Valid-Against-allOf-the-Subschemas(AND)
@Test public void testSp() { String objStr = "{\"name\":\"John Doe\",\"age\":41.5}"; String schemaStr = "{\"$defs\":{\"ageLimit\":{\"minimum\":18,\"maximum\":60},\"ageType\":{\"type\":\"integer\"}},\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"age\":{\"allOf\":[{\"$ref\":\"#/$defs/ageLimit\"},{\"$ref\":\"#/$defs/ageType\"}]}},\"required\":[\"name\"]}"; JSONObject schemaJson = JSON.parseObject(schemaStr); JSONSchema schema = JSONSchema.of(schemaJson); // 验证JSON数据 ValidateResult result = schema.validate(JSONObject.parseObject(objStr)); Assertions.assertFalse(result.isSuccess()); }
可以兼容 json-schema tour 里的所有场景
经过 debug,发现问题
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题描述
schema 的 allOf 无效
环境信息
请填写以下信息:
重现步骤
根据schema教程
https://tour.json-schema.org/content/06-Combining-Subschemas/03-Valid-Against-allOf-the-Subschemas(AND)
期待的正确结果
可以兼容 json-schema tour 里的所有场景
附加信息
经过 debug,发现问题
The text was updated successfully, but these errors were encountered: