使用Java进行JSON模式验证 [英] JSON schema validation using java

查看:371
本文介绍了使用Java进行JSON模式验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为返回JSON对象的Java Web应用程序编写一些验收测试.我想验证返回的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模式验证器 > 使用犀牛.

An alternative could be to validate running the (JavaScript) JSON Schema Validator using Rhino.

这篇关于使用Java进行JSON模式验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆