【发布时间】:2017-01-04 05:29:15
【问题描述】:
我正在评估来自 NewtonSoft 的 Json.Net.Schema 和来自 GitHub 的 NJsonSchema,但我无法弄清楚如何从 JSON 对象创建 JSON 模式。我希望它像这个网站一样工作:http://jsonschema.net/#/
我在寻找什么
string json = @"{""Name"": ""Bill"",""Age"": 51,""IsTall"": true}";
var jsonSchemaRepresentation = GetSchemaFromJsonObject(json);
我希望 jsonSchemaRepresentation 变量中有一个有效的 JSON 模式。有谁知道我如何做到这一点?
提前致谢!
【问题讨论】:
-
你在
jsonSchemaRepresentation中最终得到了什么架构(即它有什么问题?) -
该方法是一种组合方法。我需要创建一个将 json 转换为相应 json 模式的方法。
-
您找到解决方案了吗?
-
我没有找到解决办法
标签: c# json json.net jsonschema