Closed
Description
Originally proposed by @geraintluff at https://github.com/json-schema/json-schema/wiki/baseUri-(v5-proposal)
The content below is exactly as it appears on the old wiki:
Proposed keywords
baseUri
Purpose
For convenience, specify a base URI against which schema-defined links will be resolved. This allows shorter href
values.
Values
baseUri
must be a URI Template (resolved against current base URI, or request URI).
(v4 actually mentioned that rel="self" links could be used for this, but that's not ideal.)
Example
{
"baseUri": "/items/{id}/",
"links": [
{
"rel": "comments",
"href": "comments/"
},
{
"rel": "related",
"href": "related/"
}
]
}
Concerns
Does this propagate into children? Either:
- You have to also specify
baseUri
for every schema that defines links baseUri
applies to the data - at which point, what if multiple schemas have multiple values? Ideally, each schema would use its ownbaseUri
for its own links, but that gets complicated when it comes to child properties.