From 0138641f9b8ae68fdb604e080c0c9e072a49b6de Mon Sep 17 00:00:00 2001 From: Nate Otto Date: Sun, 23 Feb 2014 13:08:55 -0800 Subject: [PATCH 01/10] defines badgeClass in JSON-schema, a sample extension for age target, and a sample extended badge class that uses it --- badgeExtensions-schema/badgeClass.json | 21 +++++ .../schema-age-target-v0.5.json | 16 ++++ badgeExtensions-schema/schema-badgeClass.json | 88 +++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 badgeExtensions-schema/badgeClass.json create mode 100644 badgeExtensions-schema/schema-age-target-v0.5.json create mode 100644 badgeExtensions-schema/schema-badgeClass.json diff --git a/badgeExtensions-schema/badgeClass.json b/badgeExtensions-schema/badgeClass.json new file mode 100644 index 0000000..3c344a8 --- /dev/null +++ b/badgeExtensions-schema/badgeClass.json @@ -0,0 +1,21 @@ +{ + "name": "Sample Extended Badge", + "description": "For doing awesome things in fairly standard ways.", + "image": "https://example.org/extended-badge-longcat.png", + "criteria": "https://example.org/extended-badge.html", + "tags": ["badgeClassExtensions"], + "issuer": "https://example.org/organization.json", + "badgeClassExtensions": [ + { + "badgeSpecification": { + "title": "Badge Age Target", + "reference": "http://this-domain.org/schema-age-target-v0.5.json", + "version": "0.5" + }, + "content": { + "age": "5-18", + "grade": "K-12" + } + }, + ] +} \ No newline at end of file diff --git a/badgeExtensions-schema/schema-age-target-v0.5.json b/badgeExtensions-schema/schema-age-target-v0.5.json new file mode 100644 index 0000000..4dd45be --- /dev/null +++ b/badgeExtensions-schema/schema-age-target-v0.5.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title" : "Badge Age Target", + "description": "A suggested age or US grade range targeted by the described badge or learning experience. Use one or both options.", + "type": "object", + "properties": { + "age": { + "description": "The targeted age range for a badge or learning experience (e.g. '6-10')", + "type": "string" + }, + "grade": { + "description": "The targeted US grade range for a badge or learning experience (e.g. 'K-3')", + "type": "string" + } + } +} \ No newline at end of file diff --git a/badgeExtensions-schema/schema-badgeClass.json b/badgeExtensions-schema/schema-badgeClass.json new file mode 100644 index 0000000..cb0bdc9 --- /dev/null +++ b/badgeExtensions-schema/schema-badgeClass.json @@ -0,0 +1,88 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title" : "Open Badge BadgeClass Definition v1.1", + "description": "A suggested age or US grade range targeted by the described badge or learning experience. Use one or both options.", + "type": "object", + "properties": { + "name": { + "description": "A name or title of the particular badge defined in the present badge class, which could then be issued to many recipients.", + "type": "string" + }, + "description": { + "description": "A short description of the achievement represented by the present badge.", + "type": "string" + }, + "image": { + "description": "The URL of the image that represents the present achievement. It will be baked into a complete badge for each recipient.", + "type": "string" + }, + "criteria": { + "description": "The URL of a human-readable page describing the URL of the criteria for earning the achievement. If the badge represents an educational achievement, consider marking up this up with LRMI.", + "type": "string" + }, + "issuer": { + "description": "URL of an object describing the organization that issued the badge. Endpoint should be JSON following the IssuerOrganization schema", + "type": "string" + }, + "tags": { + "description": "An array of text: List of tags that describe the type of achievement.", + "type": "array", + "items": { + "type": "string" + } + }, + "alignment": { + "description": "List of objects describing which educational standards this badge aligns to, if any. An array of AlignmentObjects.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "Name of the alignment.", + "type": "string" + }, + "url": { + "description": "URL linking to the official description of the standard.", + "type": "string" + }, + "description": { + "description": "Short description of the standard.", + "type": "string" + } + }, + "required": ["name","url"] + } + }, + "badgeClassExtensions": { + "description": "An array of objects each linking to and fulfilling a schema for additional badge class information", + "type": "array", + "items": { + "type": "object", + "properties": { + "badgeSpecification": { + "type": "object", + "properties": { + "title": { + "description": "Short descriptive name of the extension that indicates what information it will add to the badgeClass.", + "type": "string" + }, + "reference": { + "description": "URL to the JSON-schema file defining the structure of this extension", + "type": "string" + }, + "version": { + "description": "Version string of the extension (is this necessary or should it be folded into the reference?)", + "type": "string" + } + }, + "required": ["reference"] + }, + "content": { + "type": "object" + } + }, + "required": ["badgeSpecification", "content"] + } + } + } +} \ No newline at end of file From 25ff730371fe047ed7a86ec2decca16dafd1c686 Mon Sep 17 00:00:00 2001 From: Nate Otto Date: Sun, 23 Feb 2014 13:29:15 -0800 Subject: [PATCH 02/10] updated description to be get rid of inaccurate text I had copied in --- badgeExtensions-schema/schema-badgeClass.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badgeExtensions-schema/schema-badgeClass.json b/badgeExtensions-schema/schema-badgeClass.json index cb0bdc9..697d6e1 100644 --- a/badgeExtensions-schema/schema-badgeClass.json +++ b/badgeExtensions-schema/schema-badgeClass.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", "title" : "Open Badge BadgeClass Definition v1.1", - "description": "A suggested age or US grade range targeted by the described badge or learning experience. Use one or both options.", + "description": "A schematic defining how an issuer defines an open badge to issue to its users", "type": "object", "properties": { "name": { From e1d3388136302d82821599682a88080c77396fe4 Mon Sep 17 00:00:00 2001 From: Nate Otto Date: Mon, 10 Mar 2014 16:01:51 -0400 Subject: [PATCH 03/10] 2 spaces for tabs, renames extension object based on suggestions --- badgeExtensions-schema/badgeClass.json | 4 +- .../schema-age-target-v0.5.json | 28 +-- badgeExtensions-schema/schema-badgeClass.json | 172 +++++++++--------- 3 files changed, 102 insertions(+), 102 deletions(-) diff --git a/badgeExtensions-schema/badgeClass.json b/badgeExtensions-schema/badgeClass.json index 3c344a8..a3f9f78 100644 --- a/badgeExtensions-schema/badgeClass.json +++ b/badgeExtensions-schema/badgeClass.json @@ -5,9 +5,9 @@ "criteria": "https://example.org/extended-badge.html", "tags": ["badgeClassExtensions"], "issuer": "https://example.org/organization.json", - "badgeClassExtensions": [ + "extensions": [ { - "badgeSpecification": { + "schema": { "title": "Badge Age Target", "reference": "http://this-domain.org/schema-age-target-v0.5.json", "version": "0.5" diff --git a/badgeExtensions-schema/schema-age-target-v0.5.json b/badgeExtensions-schema/schema-age-target-v0.5.json index 4dd45be..595b29a 100644 --- a/badgeExtensions-schema/schema-age-target-v0.5.json +++ b/badgeExtensions-schema/schema-age-target-v0.5.json @@ -1,16 +1,16 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", - "title" : "Badge Age Target", - "description": "A suggested age or US grade range targeted by the described badge or learning experience. Use one or both options.", - "type": "object", - "properties": { - "age": { - "description": "The targeted age range for a badge or learning experience (e.g. '6-10')", - "type": "string" - }, - "grade": { - "description": "The targeted US grade range for a badge or learning experience (e.g. 'K-3')", - "type": "string" - } - } + "$schema": "http://json-schema.org/draft-04/schema#", + "title" : "Badge Age Target", + "description": "A suggested age or US grade range targeted by the described badge or learning experience. Use one or both options.", + "type": "object", + "properties": { + "age": { + "description": "The targeted age range for a badge or learning experience (e.g. '6-10')", + "type": "string" + }, + "grade": { + "description": "The targeted US grade range for a badge or learning experience (e.g. 'K-3')", + "type": "string" + } + } } \ No newline at end of file diff --git a/badgeExtensions-schema/schema-badgeClass.json b/badgeExtensions-schema/schema-badgeClass.json index 697d6e1..b6c355b 100644 --- a/badgeExtensions-schema/schema-badgeClass.json +++ b/badgeExtensions-schema/schema-badgeClass.json @@ -1,88 +1,88 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", - "title" : "Open Badge BadgeClass Definition v1.1", - "description": "A schematic defining how an issuer defines an open badge to issue to its users", - "type": "object", - "properties": { - "name": { - "description": "A name or title of the particular badge defined in the present badge class, which could then be issued to many recipients.", - "type": "string" - }, - "description": { - "description": "A short description of the achievement represented by the present badge.", - "type": "string" - }, - "image": { - "description": "The URL of the image that represents the present achievement. It will be baked into a complete badge for each recipient.", - "type": "string" - }, - "criteria": { - "description": "The URL of a human-readable page describing the URL of the criteria for earning the achievement. If the badge represents an educational achievement, consider marking up this up with LRMI.", - "type": "string" - }, - "issuer": { - "description": "URL of an object describing the organization that issued the badge. Endpoint should be JSON following the IssuerOrganization schema", - "type": "string" - }, - "tags": { - "description": "An array of text: List of tags that describe the type of achievement.", - "type": "array", - "items": { - "type": "string" - } - }, - "alignment": { - "description": "List of objects describing which educational standards this badge aligns to, if any. An array of AlignmentObjects.", - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "description": "Name of the alignment.", - "type": "string" - }, - "url": { - "description": "URL linking to the official description of the standard.", - "type": "string" - }, - "description": { - "description": "Short description of the standard.", - "type": "string" - } - }, - "required": ["name","url"] - } - }, - "badgeClassExtensions": { - "description": "An array of objects each linking to and fulfilling a schema for additional badge class information", - "type": "array", - "items": { - "type": "object", - "properties": { - "badgeSpecification": { - "type": "object", - "properties": { - "title": { - "description": "Short descriptive name of the extension that indicates what information it will add to the badgeClass.", - "type": "string" - }, - "reference": { - "description": "URL to the JSON-schema file defining the structure of this extension", - "type": "string" - }, - "version": { - "description": "Version string of the extension (is this necessary or should it be folded into the reference?)", - "type": "string" - } - }, - "required": ["reference"] - }, - "content": { - "type": "object" - } - }, - "required": ["badgeSpecification", "content"] - } - } - } + "$schema": "http://json-schema.org/draft-04/schema#", + "title" : "Open Badge BadgeClass Definition v1.1", + "description": "A schematic defining how an issuer defines an open badge to issue to its users", + "type": "object", + "properties": { + "name": { + "description": "A name or title of the particular badge defined in the present badge class, which could then be issued to many recipients.", + "type": "string" + }, + "description": { + "description": "A short description of the achievement represented by the present badge.", + "type": "string" + }, + "image": { + "description": "The URL of the image that represents the present achievement. It will be baked into a complete badge for each recipient.", + "type": "string" + }, + "criteria": { + "description": "The URL of a human-readable page describing the criteria for earning the achievement. If the badge represents an educational achievement, consider marking up this up with LRMI.", + "type": "string" + }, + "issuer": { + "description": "URL of an object describing the organization that issued the badge. Endpoint should be JSON following the IssuerOrganization schema", + "type": "string" + }, + "tags": { + "description": "An array of text: List of tags that describe the type of achievement.", + "type": "array", + "items": { + "type": "string" + } + }, + "alignment": { + "description": "List of objects describing which educational standards this badge aligns to, if any. An array of AlignmentObjects.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "Name of the alignment.", + "type": "string" + }, + "url": { + "description": "URL linking to the official description of the standard.", + "type": "string" + }, + "description": { + "description": "Short description of the standard.", + "type": "string" + } + }, + "required": ["name","url"] + } + }, + "extensions": { + "description": "An array of objects each linking to and fulfilling a schema for additional badge class information", + "type": "array", + "items": { + "type": "object", + "properties": { + "schema": { + "type": "object", + "properties": { + "title": { + "description": "Short descriptive name of the extension that indicates what information it will add to the badgeClass.", + "type": "string" + }, + "reference": { + "description": "URL to the JSON-schema file defining the structure of this extension", + "type": "string" + }, + "version": { + "description": "Version string of the extension (is this necessary or should it be folded into the reference?)", + "type": "string" + } + }, + "required": ["reference"] + }, + "content": { + "type": "object" + } + }, + "required": ["schema", "content"] + } + } + } } \ No newline at end of file From 04019e77a5b9bac436741c1c1eb20e82e8d63c84 Mon Sep 17 00:00:00 2001 From: Nate Otto Date: Mon, 10 Mar 2014 17:41:10 -0400 Subject: [PATCH 04/10] adds checksum object with alg,hash properties to the badgeClass schema and its example --- badgeExtensions-schema/badgeClass.json | 6 +++++- badgeExtensions-schema/schema-badgeClass.json | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/badgeExtensions-schema/badgeClass.json b/badgeExtensions-schema/badgeClass.json index a3f9f78..6f3aa42 100644 --- a/badgeExtensions-schema/badgeClass.json +++ b/badgeExtensions-schema/badgeClass.json @@ -10,7 +10,11 @@ "schema": { "title": "Badge Age Target", "reference": "http://this-domain.org/schema-age-target-v0.5.json", - "version": "0.5" + "version": "0.5", + "checksum": { + "alg": "sha1", + "hash": "fakefakefakefake" + } }, "content": { "age": "5-18", diff --git a/badgeExtensions-schema/schema-badgeClass.json b/badgeExtensions-schema/schema-badgeClass.json index b6c355b..2ee00b2 100644 --- a/badgeExtensions-schema/schema-badgeClass.json +++ b/badgeExtensions-schema/schema-badgeClass.json @@ -73,6 +73,21 @@ "version": { "description": "Version string of the extension (is this necessary or should it be folded into the reference?)", "type": "string" + }, + "checksum": { + "description": "SHA-1 hash of the linked schema file so issuers may avoid downloading it repeatedly.", + "type": "object", + "properties": { + "alg": { + "description": "Hash algorithm. 'sha1' highly recommended", + "type": "string" + }, + "hash": { + "description": "string resulting from the hash of the schema file", + "type": "string" + } + }, + "required": ["alg", "hash"] } }, "required": ["reference"] From 7616aca54b9ea744fda84859f11d19cc5ccc38ac Mon Sep 17 00:00:00 2001 From: Nate Otto Date: Mon, 10 Mar 2014 17:50:32 -0400 Subject: [PATCH 05/10] switched to a single field method for adding a checksum, string like alg --- badgeExtensions-schema/badgeClass.json | 5 +---- badgeExtensions-schema/schema-badgeClass.json | 15 ++------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/badgeExtensions-schema/badgeClass.json b/badgeExtensions-schema/badgeClass.json index 6f3aa42..013b674 100644 --- a/badgeExtensions-schema/badgeClass.json +++ b/badgeExtensions-schema/badgeClass.json @@ -11,10 +11,7 @@ "title": "Badge Age Target", "reference": "http://this-domain.org/schema-age-target-v0.5.json", "version": "0.5", - "checksum": { - "alg": "sha1", - "hash": "fakefakefakefake" - } + "checksum": "sha1$cafbfd764fcdab3c238234746cb32938cbffada3" }, "content": { "age": "5-18", diff --git a/badgeExtensions-schema/schema-badgeClass.json b/badgeExtensions-schema/schema-badgeClass.json index 2ee00b2..629de54 100644 --- a/badgeExtensions-schema/schema-badgeClass.json +++ b/badgeExtensions-schema/schema-badgeClass.json @@ -75,19 +75,8 @@ "type": "string" }, "checksum": { - "description": "SHA-1 hash of the linked schema file so issuers may avoid downloading it repeatedly.", - "type": "object", - "properties": { - "alg": { - "description": "Hash algorithm. 'sha1' highly recommended", - "type": "string" - }, - "hash": { - "description": "string resulting from the hash of the schema file", - "type": "string" - } - }, - "required": ["alg", "hash"] + "description": "SHA-1 hash of the linked schema file so issuers may avoid downloading it repeatedly. use format: alg$hash", + "type": "string", } }, "required": ["reference"] From d0dede71147da1803ff746ad93bd9c323f08a2a0 Mon Sep 17 00:00:00 2001 From: Nate Otto Date: Wed, 12 Mar 2014 10:28:21 -0700 Subject: [PATCH 06/10] removed title and version properties from extension schema object --- badgeExtensions-schema/badgeClass.json | 4 +--- badgeExtensions-schema/schema-badgeClass.json | 8 -------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/badgeExtensions-schema/badgeClass.json b/badgeExtensions-schema/badgeClass.json index 013b674..66a2243 100644 --- a/badgeExtensions-schema/badgeClass.json +++ b/badgeExtensions-schema/badgeClass.json @@ -8,10 +8,8 @@ "extensions": [ { "schema": { - "title": "Badge Age Target", "reference": "http://this-domain.org/schema-age-target-v0.5.json", - "version": "0.5", - "checksum": "sha1$cafbfd764fcdab3c238234746cb32938cbffada3" + "checksum": "sha1$596d1c1c7ab83eed4f62f445fe2489086c6e3d36" }, "content": { "age": "5-18", diff --git a/badgeExtensions-schema/schema-badgeClass.json b/badgeExtensions-schema/schema-badgeClass.json index 629de54..d15dd50 100644 --- a/badgeExtensions-schema/schema-badgeClass.json +++ b/badgeExtensions-schema/schema-badgeClass.json @@ -62,18 +62,10 @@ "schema": { "type": "object", "properties": { - "title": { - "description": "Short descriptive name of the extension that indicates what information it will add to the badgeClass.", - "type": "string" - }, "reference": { "description": "URL to the JSON-schema file defining the structure of this extension", "type": "string" }, - "version": { - "description": "Version string of the extension (is this necessary or should it be folded into the reference?)", - "type": "string" - }, "checksum": { "description": "SHA-1 hash of the linked schema file so issuers may avoid downloading it repeatedly. use format: alg$hash", "type": "string", From feefc0a7f5f5a7fcd08963022a527165119057ae Mon Sep 17 00:00:00 2001 From: Nate Otto Date: Sat, 22 Mar 2014 09:17:09 -0700 Subject: [PATCH 07/10] adds format:uri to badgeclass where needed --- badgeExtensions-schema/schema-badgeClass.json | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/badgeExtensions-schema/schema-badgeClass.json b/badgeExtensions-schema/schema-badgeClass.json index d15dd50..c63f524 100644 --- a/badgeExtensions-schema/schema-badgeClass.json +++ b/badgeExtensions-schema/schema-badgeClass.json @@ -14,15 +14,18 @@ }, "image": { "description": "The URL of the image that represents the present achievement. It will be baked into a complete badge for each recipient.", - "type": "string" + "type": "string", + "format": "uri" }, "criteria": { "description": "The URL of a human-readable page describing the criteria for earning the achievement. If the badge represents an educational achievement, consider marking up this up with LRMI.", - "type": "string" + "type": "string", + "format": "uri" }, "issuer": { "description": "URL of an object describing the organization that issued the badge. Endpoint should be JSON following the IssuerOrganization schema", - "type": "string" + "type": "string", + "format": "uri" }, "tags": { "description": "An array of text: List of tags that describe the type of achievement.", @@ -43,14 +46,16 @@ }, "url": { "description": "URL linking to the official description of the standard.", - "type": "string" + "type": "string", + "format": "uri" }, "description": { "description": "Short description of the standard.", "type": "string" } }, - "required": ["name","url"] + "required": ["name","url"], + "additionalProperties": false } }, "extensions": { @@ -64,11 +69,12 @@ "properties": { "reference": { "description": "URL to the JSON-schema file defining the structure of this extension", - "type": "string" + "type": "string", + "format": "uri" }, "checksum": { "description": "SHA-1 hash of the linked schema file so issuers may avoid downloading it repeatedly. use format: alg$hash", - "type": "string", + "type": "string" } }, "required": ["reference"] From f6d2abe0eeb03d4ddcde7c6b24a83d1060895ced Mon Sep 17 00:00:00 2001 From: Nate Otto Date: Sat, 22 Mar 2014 09:41:21 -0700 Subject: [PATCH 08/10] deletes errant comma making json invalid --- badgeExtensions-schema/badgeClass.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badgeExtensions-schema/badgeClass.json b/badgeExtensions-schema/badgeClass.json index 66a2243..d996d7e 100644 --- a/badgeExtensions-schema/badgeClass.json +++ b/badgeExtensions-schema/badgeClass.json @@ -15,6 +15,6 @@ "age": "5-18", "grade": "K-12" } - }, + } ] } \ No newline at end of file From 61eeba7b298c51743c3fbcbf9eef5204cf2e7080 Mon Sep 17 00:00:00 2001 From: Nate Otto Date: Sat, 22 Mar 2014 09:42:05 -0700 Subject: [PATCH 09/10] adds regex pattern for checksum to match, w/ escaped backslashes --- badgeExtensions-schema/schema-badgeClass.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/badgeExtensions-schema/schema-badgeClass.json b/badgeExtensions-schema/schema-badgeClass.json index c63f524..09adc02 100644 --- a/badgeExtensions-schema/schema-badgeClass.json +++ b/badgeExtensions-schema/schema-badgeClass.json @@ -74,7 +74,8 @@ }, "checksum": { "description": "SHA-1 hash of the linked schema file so issuers may avoid downloading it repeatedly. use format: alg$hash", - "type": "string" + "type": "string", + "format": "^\\w+\\$\\w+$" } }, "required": ["reference"] From 02f55721752ad0932075c86d9902feb00ddb96df Mon Sep 17 00:00:00 2001 From: Nate Otto Date: Sat, 22 Mar 2014 09:46:26 -0700 Subject: [PATCH 10/10] corrects regex pattern for checksum to match, w/ escaped backslashes --- badgeExtensions-schema/schema-badgeClass.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badgeExtensions-schema/schema-badgeClass.json b/badgeExtensions-schema/schema-badgeClass.json index 09adc02..861def2 100644 --- a/badgeExtensions-schema/schema-badgeClass.json +++ b/badgeExtensions-schema/schema-badgeClass.json @@ -75,7 +75,7 @@ "checksum": { "description": "SHA-1 hash of the linked schema file so issuers may avoid downloading it repeatedly. use format: alg$hash", "type": "string", - "format": "^\\w+\\$\\w+$" + "pattern": "^\\w+\\$\\w+$" } }, "required": ["reference"]