Skip to content

Instantly share code, notes, and snippets.

@geraintluff
Created January 29, 2013 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geraintluff/4664645 to your computer and use it in GitHub Desktop.
Save geraintluff/4664645 to your computer and use it in GitHub Desktop.
When using canonical addressing, these two schemas should behave *exactly* the same. Canonical addressing means that the use of "id" has *no* effect on schema lookup/dereferencing- so *neither* of these examples would have any effect on references to "http://example.com/other-schema#" anywhere else.
{
"title": "Some schema",
"items": {
"id": "http://example.com/other-schema",
"type": "array",
"items": {"$ref": "#"}
}
}
{
"title": "Some schema",
"items": {
"type": "array",
"items": {"$ref": "http://example.com/other-schema#"}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment