Skip to content

Commit

Permalink
Merge pull request #74 from grandcentrix/rel_value_constraints
Browse files Browse the repository at this point in the history
Rel value constraints
  • Loading branch information
kevinswiber authored Nov 23, 2016
2 parents 937eba0 + 034cdf6 commit 8bd8b6f
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Describes the nature of an entity's content based on the current representation.

#####`rel`

Defines the relationship of the sub-entity to its parent, per [Web Linking (RFC5988)](http://tools.ietf.org/html/rfc5988). MUST be an array of strings. Required.
Defines the relationship of the sub-entity to its parent, per [Web Linking (RFC5988)](http://tools.ietf.org/html/rfc5988) and [Link Relations](http://www.iana.org/assignments/link-relations/link-relations.xhtml). MUST be an array of strings. Required.

#####`href`

Expand Down Expand Up @@ -152,7 +152,7 @@ Links may contain the following attributes:

###`rel`

Defines the relationship of the link to its entity, per [Web Linking (RFC5988)](http://tools.ietf.org/html/rfc5988). MUST be an array of strings. Required.
Defines the relationship of the link to its entity, per [Web Linking (RFC5988)](http://tools.ietf.org/html/rfc5988) and [Link Relations](http://www.iana.org/assignments/link-relations/link-relations.xhtml). MUST be an array of strings. Required.

###`class`

Expand Down
99 changes: 96 additions & 3 deletions siren.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"description": "Defines the relationship of the sub-entity to its parent, per Web Linking (RFC5899).",
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/RelValue"
},
"minItems": 1
},
Expand Down Expand Up @@ -95,7 +95,7 @@
"description": "Defines the relationship of the sub-entity to its parent, per Web Linking (RFC5899).",
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/RelValue"
},
"minItems": 1
}
Expand Down Expand Up @@ -250,7 +250,7 @@
"description": "Defines the relationship of the link to its entity, per Web Linking (RFC5988).",
"type": "array",
"items": {
"type": "string"
"$ref": "#/definitions/RelValue"
}
},
"href": {
Expand All @@ -263,6 +263,99 @@
"type": "string"
}
}
},
"RelValue": {
"anyOf": [
{
"type": "string",
"format": "uri"
},
{
"type": "string",
"enum": [
"about",
"alternate",
"appendix",
"archives",
"author",
"blocked-by",
"bookmark",
"canonical",
"chapter",
"collection",
"contents",
"convertedFrom",
"copyright",
"create-form",
"current",
"derivedfrom",
"describedby",
"describes",
"disclosure",
"dns-prefetch",
"duplicate",
"edit",
"edit-form",
"edit-media",
"enclosure",
"first",
"glossary",
"help",
"hosts",
"hub",
"icon",
"index",
"item",
"last",
"latest-version",
"license",
"lrdd",
"memento",
"monitor",
"monitor-group",
"next",
"next-archive",
"nofollow",
"noreferrer",
"original",
"payment",
"pingback",
"preconnect",
"predecessor-version",
"prefetch",
"preload",
"prerender",
"prev",
"preview",
"previous",
"prev-archive",
"privacy-policy",
"profile",
"related",
"restconf",
"replies",
"search",
"section",
"self",
"service",
"start",
"stylesheet",
"subsection",
"successor-version",
"tag",
"terms-of-service",
"timegate",
"timemap",
"type",
"up",
"version-history",
"via",
"webmention",
"working-copy",
"working-copy-of"
]
}
]
}
}
}

0 comments on commit 8bd8b6f

Please sign in to comment.