Skip to content

Instantly share code, notes, and snippets.

@zigorou
Created June 2, 2014 08:41
Show Gist options
  • Save zigorou/59f1746c0612d4224327 to your computer and use it in GitHub Desktop.
Save zigorou/59f1746c0612d4224327 to your computer and use it in GitHub Desktop.
HAL schema written by JSON Schema draft-04
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Hypermedia Application Languchage schema",
"definitions": {
"linkObject": {
"type": "object",
"properties": {
"href": {
"title": "Resource URI",
"type": "string",
"format": "uri"
},
"templated": {
"title": "Whether the value of href property is URI Template",
"type": "boolean",
"default": false
},
"type": {
"title": "Media type",
"type": "string"
},
"deprecation": {
"title": "URI describes reason of deprecation",
"type": "string",
"format": "uri"
},
"name": {
"title": "Share the same relation type",
"type": "string"
},
"profile": {
"title": "The profile link attribute of target resouce",
"type": "string",
"format": "uri"
},
"title": {
"type": "string"
},
"hreflang": {
"type": "string"
}
},
"required": ["href"]
}
},
"type": "object",
"properties": {
"__links": {
"title": "Contains links and other related resources",
"type": "object",
"patternProperties": {
"\\A.+\\z": { "$ref": "#" }
}
},
"__embeded": {
"title": "Contains embeded resources",
"type": "object",
"patternProperties": {
"\\A.+\\z": { "$ref": "#" }
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment