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
var schemaDef = """ { type: "object", properties: { longitude: { type: "number", minimum: -180, maximum: 180 }, latitude: { type: "number", minimum: -90, maximum: 90 } }, required: ["longitude", "latitude"] } """; var schema = JSONSchema.parseSchema(schemaDef); var result = schema.validate( JSONObject.of("longitude", 201, "latitude1", 30.2741) ); Console.log("Validate: {}", result.getMessage());
比如当前json中缺少'latitude' 属性, 但是校验结果只有 “required”。 我该如何知道具体需要那个属性呢?
The text was updated successfully, but these errors were encountered:
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.12-SNAPSHOT/ 问题已修复,请帮忙用2.0.12-SNAPSHOT版本验证,2.0.12版本预计在8月21日前发布
Sorry, something went wrong.
已验证。对于required 规则,有属性指示,但对于其它验证规则(如:max、min等)无属性提示。 建议在验证结果中单独增加一个API,用于获取不符合规则的所有字段信息。谢谢!
@sniper-xx 更新的快照版本,max/min都已经支持属性提示
JSONSchema ValidateResult add more error info, for issue #684
c609800
https://github.com/alibaba/fastjson2/releases/tag/2.0.12 问题已修复,请用新版本
No branches or pull requests
请描述您的问题
比如当前json中缺少'latitude' 属性, 但是校验结果只有 “required”。 我该如何知道具体需要那个属性呢?
The text was updated successfully, but these errors were encountered: