一、简介
我们先看下面的json数据
{ "id": 1, "name": "g2", "desc":"b2" }
假设, 我们要求id为long型, id、name非空。desc可空。如何衡量json数据是有效的呢?现在流行的json schema 是用来校验json数据是否合法。
详情请移至 https://github.com/daveclayton/json-schema-validator
二、参考文献
http://json-schema.org/example1.html
时间: 2025-01-17 18:45:02