Can not convert Array to Boolean
I am attempting to use a JSON schema to POCO converter, and I am receiving the following error when loading the https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json file.
I have attempted a number of tools to build there objects in C# but they all throw a similar error. unfortunately none of the tools specify what Array is attempting to be converted to Boolean.
is there a typo here?
Hi @ntregillus , make sure you are using tooling for JSON Schema Draft 4 (not 3) for this schema. We are using this schema with a Java JSON schema tolling without any problems.
This schema follows JSON Schema Draft 4 (http://json-schema.org/draft-04/schema#) rules. Is it possible that your C# tooling is trying to parsing it using JSON Schema Draft 3 (not 4) rules?
In Draft 3, the valueof required attribute should be boolean, while in Draft 4 it's an array, like here :
"required": [
"version",
"title"
],
Using JSON Schema v3 parser could create an error like yours:
Array is attempting to be converted to Boolean
@ntregillus Out of curiosity, what do you want to do with the POCOs of the OpenAPI spec.
interesting.... I'll see what version i should use.... i was trying to build the schema with newton soft's toolset...
If there's anything else to do for this, it seems to be a JSON Schema tooling issue and not an OpenAPI Specification issue. Closing.