From 3c18d4d9114c6cf79620bd0f056e67c15bb5c4b0 Mon Sep 17 00:00:00 2001 From: scribblemaniac Date: Tue, 10 May 2016 23:34:01 -0600 Subject: [PATCH] Added JSON schema support to CI --- circle.yml | 2 + data.json | 8 +-- schema.json | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+), 4 deletions(-) create mode 100644 schema.json diff --git a/circle.yml b/circle.yml index d66650a8..a272f0ad 100644 --- a/circle.yml +++ b/circle.yml @@ -4,8 +4,10 @@ machine: test: pre: - gem install awesome_bot + - sudo pip install json-spec override: - awesome_bot README.md --white-list developer.apple + - json validate --schema-file=schema.json --document-file=data.json general: artifacts: - "ab-results.json" diff --git a/data.json b/data.json index d30f29aa..ff480298 100644 --- a/data.json +++ b/data.json @@ -1080,8 +1080,8 @@ }, { "title": "Smart Traveller (UberGuide)", "category": "location", - "description": "(https://github.com/hACKbUSTER/UberGuide-iOS): Simple and comfortable way to explore a city using Uber API", - "source": "UberGuide", + "description": "Simple and comfortable way to explore a city using Uber API", + "source": "https://github.com/hACKbUSTER/UberGuide-iOS", "stars": 100 }, { "title": "VisitBCN", @@ -1670,7 +1670,7 @@ "title": "FreeOTP Authenticator", "category": "security", "description": "Two-Factor Authentication", - "homepage": "https://fedorahosted.org/freeotp/browser/ios", + "source": "https://fedorahosted.org/freeotp/browser/ios", "itunes": "https://itunes.apple.com/app/freeotp/id872559395" }, { "title": "MasterPassword", @@ -2567,4 +2567,4 @@ "itunes": "https://itunes.apple.com/app/toggl-timer/id885767775", "stars": 100 }] -} \ No newline at end of file +} diff --git a/schema.json b/schema.json new file mode 100644 index 00000000..65a137f6 --- /dev/null +++ b/schema.json @@ -0,0 +1,143 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$id": "https://raw.githubusercontent.com/dkhamsing/open-source-ios-apps/master/schema.json", + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "header": { + "type": "string" + }, + "footer": { + "type": "string" + }, + "categories": { + "type": "array", + "uniqueItems": true, + "items": { + "title": "Category Object", + "description": "A category to group project objects under.", + "properties": { + "title": { + "title": "Category Title", + "description": "A human-readable identifier for the category.", + "type": "string" + }, + "id": { + "title": "Category Identifier", + "description": "A short identifier designed for programs. It should only contain lowercase alphanumeric characters and a - (dash) for replacing spaces.", + "type": "string", + "pattern": "^[^A-Z_ ]+$" + }, + "description": { + "title": "Category Description", + "description": "A description of the category meant to be provided to the user.", + "type": "string", + "default": "" + }, + "parent": { + "title": "Category Parent", + "description": "Makes the current category a subcategory of the category with an id that matches this value.", + "type": ["string", "null"], + "default": null + } + }, + "required": ["title", "id"], + "additionalProperties": false + } + }, + "projects": { + "type": "array", + "uniqueItems": true, + "items": { + "title": "Project Object", + "description": "An object that holds all the information for a specific project.", + "properties": { + "title": { + "title": "Project Title", + "description": "The official title of the project.", + "type": "string" + }, + "category": { + "title": "Project Category", + "description": "The category or list of categories that the project falls under. If it is a list, the categories should be ordered from most to least relevant/applicable to the project.", + "type": ["string", "array"], + "items": { + "type": "string" + } + }, + "description": { + "title": "Project Description", + "description": "A brief 1 sentence summary of the project.", + "type": "string" + }, + "lang": { + "title": "Project Language", + "description": "A three-character ISO 639-2 code representing the primary language of the project, or a list of such codes, with the primary language first.", + "type": ["string", "array"], + "minLength": 3, + "maxLength": 3, + "minItems": 1, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 3 + }, + "default": "eng" + }, + "country": { + "title": "Project Country", + "description": "The country that the project operates out of or the country the project is designed for (if designed for a specific location). Null if country is unclear/unspecified.", + "type": ["string", "null"], + "minLength": 2, + "maxLength": 2, + "default": null + }, + "source": { + "title": "Project Source", + "description": "A URL where the source code to the project can be found.", + "type": "string", + "pattern": "^https?:\\/\\/.*?\\..*$" + }, + "homepage": { + "title": "Project Homepage", + "description": "The URL for the project's homepage.", + "type": ["string", "null"], + "pattern": "^https?:\\/\\/.*?\\..*$", + "default": null + }, + "itunes": { + "title": "Project iTunes Page", + "description": "The URL for iTunes page for the project's app.", + "type": ["string", "null"], + "pattern": "^https:\\/\\/itunes\\.apple\\.com\\/(in\\/)?app\\/([^\\/]+\\/)?id[0-9]+$", + "default": null + }, + "stars": { + "title": "Project Stars", + "description": "The number of stars a project has on Github, or null if the project is not a Github project.", + "type": ["null", "number"], + "multipleOf": 1.0, + "minimum": 0, + "default": null + }, + "tags": { + "title": "Project Tags", + "description": "A place to put any metadata for a project. The items can be any type.", + "type": "array", + "default": [] + } + + }, + "required": ["title", "category", "description", "source"], + "additionalProperties": false + } + } + }, + "required": ["title", "categories", "projects"], + "additionalProperties": false +}