Newtonsoft创建具有许多类型的JSchema数组吗?

时间:2019-02-22 10:57:51

标签: json json.net jsonschema

创建包含许多项的数组不起作用。

示例代码:

JSchema array = new JSchema { Type = JSchemaType.Array };
array.Items.Add(new JSchema { Type = JSchemaType.Integer });
array.Items.Add(new JSchema { Type = JSchemaType.String }); // doesn't exists in JSON Schema

new JSchema
            {
                Type = JSchemaType.Object,
                Properties = {
                    { "Array", array }
                }
            };

0 个答案:

没有答案