【发布时间】:2018-04-06 17:11:44
【问题描述】:
我有一个输入 Json,我想在 JAVA Rest API 中针对服务器端的模式进行验证。我想在模式中调用自定义函数。要遵循的标准是什么,是否有任何样品。在编写模式时也有一个标准,杰克逊是否提供任何模式解析器。
我有一个提供给我的示例架构,我想在危险属性中调用自定义函数
{
"$id": "http://example.com/example.json",
"type": "object",
"definitions": {
},
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"General": {
"$id": "/properties/General",
"type": "object",
"properties": {
"Name": {
"$id": "/properties/General/properties/Name",
"type": "string",
"title": "The Name Schema ",
"default": ""
},
"Peril": {
"$id": "/properties/General/properties/Peril",
"type": "string",
"title": "The Peril Schema ",
"default": ""
}
}
}
}
我有以下 json。我想在危险值上调用自定义函数
{
"General": {
"Name": "NAEQ_DCN_MAR21",
"Peril": "Earthquake"
}
}
【问题讨论】:
标签: json jsonschema jsonparser