Skip to content

Rewrite the Hyper-Schema spec almost entirely #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Oct 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6f3d93b
"base" is a URI Template
handrews Oct 20, 2017
e24b382
Rewrite hyper-schema almost entirely
handrews Oct 20, 2017
04715a1
Add more English descriptions
handrews Sep 28, 2017
756afe3
Use numbered lists for steps
handrews Sep 28, 2017
1f7fd39
Default "submissionSchema" to true
handrews Oct 8, 2017
db7fe7c
Introduce the LDO in the introduction
handrews Oct 8, 2017
8e7b8da
Condense server-side usage overview
handrews Oct 8, 2017
69f3e3b
Keep specific keywords out of general concerns
handrews Oct 8, 2017
e92b417
Exclude LDO schema keywords from applicability
handrews Oct 8, 2017
7d64e91
Wording improvements from PR review
handrews Oct 9, 2017
c5cc781
Remove commented text, simplify Accept-Post
handrews Oct 9, 2017
0dbd8a8
Fix more typos, better variable name.
handrews Oct 9, 2017
175852e
Keep initial functionality description high-level
handrews Oct 13, 2017
95aed67
Rework implementation requirements from move
handrews Oct 13, 2017
04178da
Trim down JSON Hyper-Schemas in APIs appendix
handrews Oct 13, 2017
315a493
Next hyper-schema draft will be handrews-00
handrews Oct 14, 2017
5872491
Add output format schema, tidy up other schemas
handrews Oct 16, 2017
632a8e1
Numerous spelling fixes
handrews Oct 17, 2017
9834381
Move HTTP up between Implementation and Examples
handrews Oct 17, 2017
365ef27
Wording improvements around HTTP usage.
handrews Oct 17, 2017
2706f3e
Forgot to change appendix to section
handrews Oct 19, 2017
ef4b0f0
Forgot to finish sentence
handrews Oct 20, 2017
9bfcc50
Update core change log, rename drafts
handrews Oct 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions hyper-schema-output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"$id": "http://json-schema.org/draft-7-wip/hyper-schema-output",
"$schema": "http://json-schema.org/draft-07-wip/schema#",
"type": "array",
"items": {
"allOf": [
{"$ref": "http://json-schema.org/draft-07/links#/definitions/noRequiredFields" }
],
"type": "object",
"required": [
"contextUri",
"contextPointer",
"rel",
"attachmentPointer"
],
"if": { "required": [ "hrefSchema" ] },
"then": { "required": [ "hrefInputTemplates", "hrefPrepopulatedInput" ] },
"else": { "required": [ "targetUri" ] },
"properties": {
"contextUri": {
"$comment": "The fully resolved URI of the link context, including a fragment if it is possible to construct one for the given media type and instance",
"type": "string",
"format": "uri"
},
"contextPointer": {
"$comment": "The absolute JSON Pointer to the location in the instance that is the context of the link. If the context resource supports JSON Pointer fragments, this will the string form of the identical JSON Pointer",
"type": "string",
"format": "json-pointer"
},
"rel": {
"type": "string"
},
"targetUri": {
"$comment": "The fully resolved target URI",
"type": "string",
"format": "uri"
},
"hrefInputTemplates": {
"$comment": "The list of partially resolved URI Templates, starting with \"href\", followed by applicable \"base\" values from nearest to furthest.",
"type": "array",
"items": {
"type": "string",
"format": "uri-template"
}
},
"hrefPrepopulatedInput": {
"$comment": "The initial data set to be presented with the input form when URI Tempalte input is accepted.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: Tempalte

"type": "object",
"propertyNames": {
"$comment": "These are all URI Template variable names, specifically the 'varname' production from RFC 6570, Section 2.3",
"pattern": "^(?:\\w|(?:%[a-f\\d]{2}))+(?:\\.(?:\\w|(?:%[a-f\\d]{2})))*$"
}
},
"attachmentPointer": {
"$comment": "The absolute JSON Pointer, in string form, of the position to which this resolved link applies",
"type": "string",
"format": "json-pointer"
}
}
}
}
13 changes: 7 additions & 6 deletions hyper-schema.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"$schema": "http://json-schema.org/draft-06/hyper-schema#",
"$id": "http://json-schema.org/draft-06/hyper-schema#",
"$schema": "http://json-schema.org/draft-07-wip/hyper-schema#",
"$id": "http://json-schema.org/draft-07-wip/hyper-schema#",
"title": "JSON Hyper-Schema",
"definitions": {
"schemaArray": {
"allOf": [
{ "$ref": "http://json-schema.org/draft-06/schema#/definitions/schemaArray" },
{ "$ref": "http://json-schema.org/draft-07-wip/schema#/definitions/schemaArray" },
{
"items": { "$ref": "#" }
}
]
}
},
"allOf": [ { "$ref": "http://json-schema.org/draft-06/schema#" } ],
"allOf": [ { "$ref": "http://json-schema.org/draft-07-wip/schema#" } ],
"properties": {
"additionalItems": { "$ref": "#" },
"additionalProperties": { "$ref": "#"},
Expand Down Expand Up @@ -50,12 +50,13 @@
"propertyNames": { "$ref": "#" },

"base": {
"type": "string"
"type": "string",
"format": "uri-template"
},
"links": {
"type": "array",
"items": {
"$ref": "http://json-schema.org/draft-06/links#"
"$ref": "http://json-schema.org/draft-07-wip/links#"
}
}
},
Expand Down
6 changes: 4 additions & 2 deletions jsonschema-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<?rfc rfcedstyle="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes" ?>
<rfc category="info" docName="draft-wright-json-schema-02" ipr="trust200902">
<rfc category="info" docName="draft-handrews-json-schema-00" ipr="trust200902">
<front>
<title abbrev="JSON Schema">JSON Schema: A Media Type for Describing JSON Documents</title>

Expand Down Expand Up @@ -986,11 +986,13 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
</t>
<t>
<list style="hanging">
<t hangText="draft-wright-json-schema-02">
<t hangText="draft-handrews-json-schema-00">
<list style="symbols">
<t>Reserve "$comment" for non-user-visible notes about the schema</t>
<t>Wording improvements around "$id" and fragments</t>
<t>Note the challenges of extending meta-schemas with recursive references</t>
<t>Add "application/schema-instance+json" media type</t>
<t>Recommend a "schema" link relation / parameter instead of "profile"</t>
</list>
</t>
<t hangText="draft-wright-json-schema-01">
Expand Down
Loading