Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error converting value "True" to type 'System.Collections.Generic.ICollection`1[System.String]" #5

Open
ChrisLynchHPE opened this issue Jul 1, 2016 · 8 comments
Labels

Comments

@ChrisLynchHPE
Copy link

I'm getting the following error when I attempt to load my JSON file with what I believe is a valid JSON Schema:

Error converting value "True" to type 'System.Collections.Generic.ICollection`1[System.String]'. Path 'properties.Name.required', line 5, position 22.

I have attached the JSON Schema file, and a sample JSON file that contains the data for your reference.

My system is a Windows 10 PC (Insider Fast Ring, 14376) and v1.4.5944.34935 of your Visual JSON Editor.

HPOneView.300_CmdletHelp.json.txt
Test.json.txt

@RicoSuter
Copy link
Owner

I think this is not a draft v4 schema...

@RicoSuter
Copy link
Owner

Try removing all required attributes.. in draft v4 required contains a list of the required properties..

@ChrisLynchHPE
Copy link
Author

Not sure I completely understand. Are you suggesting that I remove the "required" property/attribute in the schema file I manually created?

@ChrisLynchHPE
Copy link
Author

Okay, so I did a bit more research, and I believe I created a JSON v4 Schema. I usedhttp://jsonschema.net/#/ to create the schema. Here is the updated schema:
HPOneView.300_CmdletHelp.json.txt

@ChrisLynchHPE
Copy link
Author

And when I use the schema file, I now get a different error:

Unable to cast object of type 'Newtonsoft.Json.Linq.JArray' to type 'Newtonsoft.Json.Linq.JObject'.

@RicoSuter
Copy link
Owner

RicoSuter commented Jul 18, 2016

The property items is used to describe a tuple type (I.e. it must be an array of schemas. I think in your case you need the item property which describes the array item type...

@ChrisLynchHPE
Copy link
Author

I used http://jsonschema.net/#/ to create the JSON v4 Schema file. The JSON object is quite simple. It is an Array of an Object that is very specific. The Object contains a String attribute called Name, then an Object called Contents. Contents contains nested objects and arrays.

Is there any way to debug your tool to find out where exactly it is generating the error?

@RicoSuter
Copy link
Owner

You can clone or download the source code and run it with debugger attached.. can you provide a sample json and json schema v4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants