I am trying to use $ref from URL & validating json data using NewtonSoft.Json.Schema.
MainSchema.json
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "Data": { "$ref": "http://localhost:49735/api/schema/sample" }, }, "required": [ "Data" ] }
SubSchema.json
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "Data": { "type": "array", "items": [ { "type": "array", "items": [ { "id": "id1", "type": "string", }, { "id": "id2", "type": "number" } ] } ] } } }
I have created one sample web api application for downloading subschema as json. URL is reffered in main schema http://localhost:49735/api/Schema/Sample The api is developed with No Authentication Mode. I am using NewtonSoft JSON Schema for validation json data. but while resolving json schema it is throwing exception.
"The remote server returned an error: (401) Unauthorized."