Skip to content

Commit

Permalink
fix(schema): Apply schema fixes from upstream (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotttf authored Aug 8, 2017
1 parent fdc11aa commit 2da44ee
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions lib/schema.json
Original file line number Diff line number Diff line change
@@ -150,29 +150,34 @@
},
"additionalProperties": false
},
"links": {

"relationshipLinks": {
"description": "A resource object **MAY** contain references to other resource objects (\"relationships\"). Relationships may be to-one or to-many. Relationships can be specified by including a member in a resource's links object.",
"type": "object",
"properties": {
"self": {
"description": "A `self` member, whose value is a URL for the relationship itself (a \"relationship URL\"). This URL allows the client to directly manipulate the relationship. For example, it would allow a client to remove an `author` from an `article` without deleting the people resource itself.",
"type": "string",
"format": "uri"
"$ref": "#/definitions/link"
},
"related": {
"$ref": "#/definitions/link"
}
},
"additionalProperties": true
},
"links": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/link"
}
},
"link": {
"description": "A link **MUST** be represented as either: a string containing the link's URL or a link object.",
"oneOf": [
{
"description": "A string containing the link's URL.",
"type": "string",
"format": "uri"
"format": "uri-reference"
},
{
"type": "object",
@@ -183,7 +188,7 @@
"href": {
"description": "A string containing the link's URL.",
"type": "string",
"format": "uri"
"format": "uri-reference"
},
"meta": {
"$ref": "#/definitions/meta"
@@ -197,7 +202,7 @@
"description": "Members of the attributes object (\"attributes\") represent information about the resource object in which it's defined.",
"type": "object",
"patternProperties": {
"^(?!relationships$|links$)\\w[-\\w_]*$": {
"^(?!relationships$|links$|id$|type$)\\w[-\\w_]*$": {
"description": "Attributes may contain any valid JSON value."
}
},
@@ -208,10 +213,10 @@
"description": "Members of the relationships object (\"relationships\") represent references from the resource object in which it's defined to other resource objects.",
"type": "object",
"patternProperties": {
"^\\w[-\\w_]*$": {
"^(?!id$|type$)\\w[-\\w_]*$": {
"properties": {
"links": {
"$ref": "#/definitions/links"
"$ref": "#/definitions/relationshipLinks"
},
"data": {
"description": "Member, whose value represents \"resource linkage\".",
@@ -287,28 +292,28 @@
"first": {
"description": "The first page of data",
"oneOf": [
{ "type": "string", "format": "uri" },
{ "type": "string", "format": "uri-reference" },
{ "type": "null" }
]
},
"last": {
"description": "The last page of data",
"oneOf": [
{ "type": "string", "format": "uri" },
{ "type": "string", "format": "uri-reference" },
{ "type": "null" }
]
},
"prev": {
"description": "The previous page of data",
"oneOf": [
{ "type": "string", "format": "uri" },
{ "type": "string", "format": "uri-reference" },
{ "type": "null" }
]
},
"next": {
"description": "The next page of data",
"oneOf": [
{ "type": "string", "format": "uri" },
{ "type": "string", "format": "uri-reference" },
{ "type": "null" }
]
}

0 comments on commit 2da44ee

Please sign in to comment.