From 5983f2a75aec6779b84218aabc40f5963ac31343 Mon Sep 17 00:00:00 2001 From: Krzysztof Nowak Date: Thu, 3 May 2018 15:48:50 +0200 Subject: [PATCH] wip jsonschema resolving Signed-off-by: Krzysztof Nowak --- asclepias_broker/config.py | 2 +- asclepias_broker/jsonschemas/event.json | 4 ++-- asclepias_broker/jsonschemas/scholix-v3.json | 4 ++-- requirements.txt | 1 + setup.py | 4 ++++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/asclepias_broker/config.py b/asclepias_broker/config.py index 3ea216b..4b3b65f 100644 --- a/asclepias_broker/config.py +++ b/asclepias_broker/config.py @@ -137,7 +137,7 @@ def _(x): # JSONSchemas # =========== -JSONSCHEMAS_HOST = 'asclepias-broker.com' +JSONSCHEMAS_HOST = 'asclepias.github.io' # Flask configuration # =================== diff --git a/asclepias_broker/jsonschemas/event.json b/asclepias_broker/jsonschemas/event.json index af28eab..91be7dc 100644 --- a/asclepias_broker/jsonschemas/event.json +++ b/asclepias_broker/jsonschemas/event.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "id": "https://raw.githubusercontent.com/asclepias/asclepias-broker/master/asclepias_broker/jsonschemas/event.json", - "title": "Event message schema.", + "id": "https://asclepias.github.io/schemas/event.json", + "title": "Asclepias Event schema.", "type": "array", "minItems": 1, "maxItems": 100, diff --git a/asclepias_broker/jsonschemas/scholix-v3.json b/asclepias_broker/jsonschemas/scholix-v3.json index f8f06fe..c48374d 100644 --- a/asclepias_broker/jsonschemas/scholix-v3.json +++ b/asclepias_broker/jsonschemas/scholix-v3.json @@ -1,6 +1,6 @@ { - "$schema": "http://json-schema.org/draft-06/schema#", - "$id": "http://www.scholix.org/schema.json", + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "https://asclepias.github.io/schemas/scholix-v3.json", "type": "object", "additionalProperties": false, "definitions": { diff --git a/requirements.txt b/requirements.txt index 2c26fca..4afa855 100644 --- a/requirements.txt +++ b/requirements.txt @@ -69,6 +69,7 @@ invenio-db==1.0.0 invenio-formatter==1.0.0 invenio-i18n==1.0.0 invenio-indexer==1.0.0 +invenio-jsonschemas==1.0.0 invenio-logging==1.0.0 invenio-mail==1.0.0 invenio-oauth2server==1.0.0 diff --git a/setup.py b/setup.py index e8ead88..66b76eb 100644 --- a/setup.py +++ b/setup.py @@ -52,6 +52,7 @@ 'Flask-Debugtoolbar>=0.10.1', 'idutils>=1.0.0', 'invenio-records-rest>=1.0.1', + 'invenio-jsonschemas>=1.0.0', 'invenio[{extras}]==3.0.0rc1'.format(extras=INVENIO_EXTRAS), 'jsonschema>=2.6.0', # TODO: Investigate `invenio-jsonschemas` usage 'marshmallow>=2.15.0', @@ -111,6 +112,9 @@ 'invenio_celery.tasks': [ 'asclepias_broker_tasks = asclepias_broker.tasks', ], + 'invenio_jsonschemas.schemas': [ + 'asclepias_broker = asclepias_broker.jsonschemas', + ], 'invenio_pidstore.fetchers': [ 'relid = asclepias_broker.pidstore:relid_fetcher', ],