The swagger-spec repository provides a JSON-schema describing a valid Swagger 2.0 API definition. I would like to use this schema in order to validate if a given API definition file is valid before I try to interpret it. I'm using the following code to load the schema using Json.NET:
JsonSchema swaggerApiSchema; using (var textReader = new JsonTextReader(new StreamReader(@"C:\path\to\schema.json"))) { swaggerApiSchema = JsonSchema.Read(textReader); } This throws an ArgumentException reporting "Can not convert Array to Boolean.".
Is there something wrong with the schema file, is this a bug with Json.NET, or am I just doing something wrong?