diff --git a/sql/doc/json b/sql/doc/json new file mode 120000 index 00000000..d1d98524 --- /dev/null +++ b/sql/doc/json @@ -0,0 +1 @@ +../json \ No newline at end of file diff --git a/sql/doc/sql b/sql/doc/sql new file mode 120000 index 00000000..8f225dac --- /dev/null +++ b/sql/doc/sql @@ -0,0 +1 @@ +../autodoc \ No newline at end of file diff --git a/sql/json/.gitignore b/sql/json/.gitignore new file mode 100644 index 00000000..c337aa9f --- /dev/null +++ b/sql/json/.gitignore @@ -0,0 +1 @@ +*-stamp diff --git a/sql/json/Makefile b/sql/json/Makefile new file mode 100644 index 00000000..5d983b81 --- /dev/null +++ b/sql/json/Makefile @@ -0,0 +1,19 @@ +# Depends: json-glib-tools + +JSONVAL = json-glib-validate +JSONS = $(wildcard *.json) + +all: validate +check: validate +test: validate + +validate: validate-stamp +validate-stamp: $(JSONS) + make $(patsubst %,validate/%,$?) + touch $@ + +validate/%: + $(JSONVAL) $* + +clean: + rm -f validate-stamp diff --git a/sql/json/entity.doap.schema.json b/sql/json/entity.doap.schema.json new file mode 100644 index 00000000..d5464383 --- /dev/null +++ b/sql/json/entity.doap.schema.json @@ -0,0 +1,4 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "http://softwareheritage.org/schemas/entity.doap.schema.json" +} diff --git a/sql/json/entity.lister_metadata.schema.json b/sql/json/entity.lister_metadata.schema.json new file mode 100644 index 00000000..d1f44046 --- /dev/null +++ b/sql/json/entity.lister_metadata.schema.json @@ -0,0 +1,4 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "http://softwareheritage.org/schemas/entity.lister_metadata.schema.json" +} diff --git a/sql/json/entity_history.doap.schema.json b/sql/json/entity_history.doap.schema.json new file mode 100644 index 00000000..777214c3 --- /dev/null +++ b/sql/json/entity_history.doap.schema.json @@ -0,0 +1,4 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "http://softwareheritage.org/schemas/entity_history.doap.schema.json" +} diff --git a/sql/json/entity_history.lister_metadata.schema.json b/sql/json/entity_history.lister_metadata.schema.json new file mode 100644 index 00000000..caec892c --- /dev/null +++ b/sql/json/entity_history.lister_metadata.schema.json @@ -0,0 +1,4 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "http://softwareheritage.org/schemas/entity_history.lister_metadata.schema.json" +} diff --git a/sql/json/fetch_history.result.schema.json b/sql/json/fetch_history.result.schema.json new file mode 100644 index 00000000..b0c919a7 --- /dev/null +++ b/sql/json/fetch_history.result.schema.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "http://softwareheritage.org/schemas/fetch_history.result.schema.json", + + "definitions": { + "counter": { + "type": "integer", + "minimum": 0 + } + }, + + "type": "object", + "properties": { + "occurrences": { "$ref": "#/definitiones/counter" }, + "directories": { "$ref": "#/definitiones/counter" }, + "revisions": { "$ref": "#/definitiones/counter" }, + "releases": { "$ref": "#/definitiones/counter" }, + "contents": { "$ref": "#/definitiones/counter" }, + "fake" : { "type": "boolean" } + } +} diff --git a/sql/json/list_history.result.schema.json b/sql/json/list_history.result.schema.json new file mode 100644 index 00000000..2d17bd53 --- /dev/null +++ b/sql/json/list_history.result.schema.json @@ -0,0 +1,4 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "http://softwareheritage.org/schemas/list_history.result.schema.json" +} diff --git a/sql/json/listable_entity.list_params.schema.json b/sql/json/listable_entity.list_params.schema.json new file mode 100644 index 00000000..8444416e --- /dev/null +++ b/sql/json/listable_entity.list_params.schema.json @@ -0,0 +1,4 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "http://softwareheritage.org/schemas/listable_entity.list_params.schema.json" +} diff --git a/sql/json/revision.metadata.schema.json b/sql/json/revision.metadata.schema.json new file mode 100644 index 00000000..e04c4b9f --- /dev/null +++ b/sql/json/revision.metadata.schema.json @@ -0,0 +1,92 @@ +{ + "$schema": "http://json-schema.org/schema#", + "id": "http://softwareheritage.org/schemas/myschema.json", + + "definitions": { + "person": { + "type": "object", + "properties": { + "name": { + "title": "full name", + "type": "string" + }, + "email": { + "title": "email address", + "type": "string", + "format": "email" + } + } + }, + "pkgid": { + "title": "debian source package identifier", + "type": "array", + "items": [ + { + "title": "package name", + "type": "string" + }, + { + "title": "package version", + "type": "string" + } + ] + } + }, + + "type": "object", + "properties": { + + "original_artifact": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "length": { "type": "integer", "minimum": 0 }, + "sha1": { "type": "string" }, + "sha1_git": { "type": "string" }, + "sha256": { "type": "string" }, + "archive_type": { "type": "string" } + } + }, + + "package_info": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "version": { "type": "string" }, + "changelog": { + "type": "object", + "properties": { + "date": { "type": "string", "format": "date-time" }, + "person": { "$ref": "#/definitions/person" }, + "history": { + "type": "array", + "items": { "$ref": "#/definitions/pkgid" } + } + } + }, + "maintainers": { + "type": "object", + "properties": { + } + }, + "pgp_signature": { + "type": "object", + "properties": { + "date": { "type": "string", "format": "date-time" }, + "keyid": { "type": "string" }, + "person": { "$ref": "#/definitions/person" } + } + }, + "lister_metadata": { + "type": "object", + "properties": { + "id": { "type": "integer" }, + "lister": { "type": "string" } + } + } + } + } + + } + +}