From 0e67a7266157a534e0b56f984a2e431eced6ac39 Mon Sep 17 00:00:00 2001 From: Thomas Davis Date: Sun, 29 Jun 2014 09:28:01 +1000 Subject: [PATCH] fleshed out schematic --- resume.json | 10 +-- schema.json | 218 ++++++++++++++++++++++++++++++++++++++++++++++++++ test/index.js | 4 +- 3 files changed, 225 insertions(+), 7 deletions(-) diff --git a/resume.json b/resume.json index 8cf7f1cf..ea7d3da4 100644 --- a/resume.json +++ b/resume.json @@ -3,12 +3,12 @@ "firstName":"", "lastName":"", "email": { - "work": null, - "personal": null + "work": "", + "personal": "" }, "phone": { - "work": null, - "personal": null + "work": "", + "personal": "" }, "summary":"", "location":{ @@ -17,7 +17,7 @@ "state":"" }, "websites": { - "blog": null + "blog": "" }, "profiles":{ "github":"", diff --git a/schema.json b/schema.json index 047667f3..cfa27502 100644 --- a/schema.json +++ b/schema.json @@ -1,4 +1,5 @@ { + "$schema": "http://json-schema.org/draft-04/schema#", "title": "Resume Schema", "type": "object", "properties": { @@ -10,8 +11,225 @@ }, "lastName": { "type": "string" + }, + "email": { + "type": "object", + "properties": { + "work": { + "type": "string" + }, + "personal": { + "type": "string" + } + } + }, + "phone": { + "type": "object", + "properties": { + "work": { + "type": "string" + }, + "personal": { + "type": "string" + } + } + }, + "summary": { + "type": "string" + }, + "location": { + "type": "object", + "properties": { + "city": { + "type": "string" + }, + "countryCode": { + "type": "string" + }, + "state": { + "type": "string" + } + } + }, + "websites": { + "type": "object", + "properties": { + "blog": { + "type": "string" + } + } + }, + "profiles": { + "type": "object", + "properties": { + "twitter": { + "type": "string" + }, + "github": { + "type": "string" + } + } } } + }, + "work": { + "type": "array", + "items": { + "type": "object", + "properties": { + "company": { + "type": "string" + }, + "position": { + "type": "string" + }, + "summary": { + "type": "string" + }, + "website": { + "type": "string" + }, + "startDate": { + "type": "string" + }, + "endDate": { + "type": "string" + }, + "highlights": { + "type": "array", + "items": { + "type": "string" + } + } + } + + } + }, + "education": { + "type": "array", + "items": { + "type": "object", + "properties": { + "institution": { + "type": "string" + }, + "area": { + "type": "string" + }, + "studyType": { + "type": "string" + }, + "startDate": { + "type": "string" + }, + "endDate": { + "type": "string" + }, + "courses": { + "type": "array", + "items": { + "type": "string" + } + } + } + + } + }, + "awards": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "awardDate": { + "type": "string" + }, + "awarder": { + "type": "string" + } + } + + } + }, + "publications": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "publisher": { + "type": "string" + }, + "releaseDate": { + "type": "string" + }, + "website": { + "type": "string" + } + } + + } + }, + "skills": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "level": { + "type": "string" + }, + "releaseDate": { + "type": "string" + }, + "keywords": { + "type": "array", + "items": { + "type": "string" + } + } + } + + } + }, + "hobbies": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "keywords": { + "type": "array", + "items": { + "type": "string" + } + } + } + + } + }, + "references": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "reference": { + "type": "string" + } + } + + } } } } diff --git a/test/index.js b/test/index.js index e7d58362..91963d31 100644 --- a/test/index.js +++ b/test/index.js @@ -3,8 +3,8 @@ var validator = require('../validator'); test('Test validator on resume.json.', function(t) { validator.validate(validator.resumeJson, function(report, err) { - t.equal(err, null, 'no error'); - t.equal(report && report.valid, true, 'schema passed.'); + t.equal(err, null, 'No formatting errors'); + t.equal(report && report.valid, true, 'Passes JsonResume v1.0.0 specification - DRAFT.'); t.end(); }); }); \ No newline at end of file