JamesNK / Newtonsoft.Json.Schema

Json.NET Schema is a powerful, complete and easy to use JSON Schema framework for .NET

Home Page:http://www.newtonsoft.com/jsonschema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Relative base uri means references cannot be resolved

jazpearson opened this issue · comments

In this simple schema example, the $id is a relative URI.
However, when i try to use $defs within the schema to make things re-usable within the schema, there are issues trying to resolve the schema reference:

Could not resolve schema reference 'schemas/customer#/$defs/name'. Path 'properties.first_name', line 5, position 19.
{
  "$id": "/schemas/customer",
  "type": "object",
  "properties": {
    "first_name": { "$ref": "#/$defs/name" }
  },
  "required": [ "first_name" ],
  "$defs": {
    "name": { "type": "string" }
  }
}

Are relative base URIs just a complete no-no or is there something wrong with the schema, or perhaps is the library missing something?

Any help would be most appreciated. We do have a license for this too.