使用 java 进行 JSON 模式验证 [英] JSON schema validation using java
本文介绍了使用 java 进行 JSON 模式验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为返回 JSON 对象的 java webapp 编写一些验收测试.我想验证返回的 JSON 是否针对架构进行了验证.任何人都可以为此推荐任何工具吗?
I'm writing some acceptance tests for a java webapp that returns JSON objects. I would like to verify that the JSON returned validates against a schema. Can anyone suggest any tools for this?
推荐答案
JSON 工具项目(程序员指南)包含一个工具使用 JSON 架构验证 JSON 文件的内容.
The JSON Tools project (Programmer's Guide) includes a tool to validate the contents of a JSON file using a JSON schema.
另一种方法是验证(JavaScript)JSON Schema Validator 使用 Rhino.
An alternative could be to validate running the (JavaScript) JSON Schema Validator using Rhino.
这篇关于使用 java 进行 JSON 模式验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文