diff --git a/cli.js b/cli.js index a531a38e164..b7d284e7db2 100644 --- a/cli.js +++ b/cli.js @@ -833,11 +833,11 @@ async function assertFileSystemIsValid() { for (const testDir of await fs.readdir(rootTestDir)) { if (isIgnoredFile(testDir)) continue - const schemaName = testDir + '.json' - const schemaPath = path.join(SchemaDir, schemaName) + const schemaPath = path.join(SchemaDir, testDir + '.json') if (!(await exists(schemaPath))) { printErrorAndExit(new Error(), [ `Failed to find a schema file at "${schemaPath}"`, + `Expected schema file computed from directory at "${path.join(rootTestDir, testDir)}"`, ]) } } diff --git a/src/api/json/catalog.json b/src/api/json/catalog.json index cc2b0276323..2e1d1248aef 100644 --- a/src/api/json/catalog.json +++ b/src/api/json/catalog.json @@ -7235,6 +7235,19 @@ "fileMatch": ["*.bitmovin.json", "*.bitmovin.yml", "*.bitmovin.yaml"], "url": "https://raw.githubusercontent.com/bitmovin/bitmovin-api-sdk-examples/main/bitmovin-encoding-template.json" }, + { + "name": "dtool dataset metadata", + "description": "Metadata attached to a dtool dataset", + "fileMatch": [ + "dtool-dataset.yml", + "dtool-dataset.yaml", + "dtool-dataset.json" + ], + "url": "https://json.schemastore.org/dtool-dataset-metadata-1.0.json", + "versions": { + "v1.0": "https://json.schemastore.org/dtool-dataset-metadata-1.0.json" + } + }, { "name": "pnpm Workspace (pnpm-workspace.yaml)", "description": "Workspace file for pnpm", diff --git a/src/schemas/json/dtool-dataset-metadata-1.0.json b/src/schemas/json/dtool-dataset-metadata-1.0.json new file mode 100644 index 00000000000..e5e6f7eb7c4 --- /dev/null +++ b/src/schemas/json/dtool-dataset-metadata-1.0.json @@ -0,0 +1,89 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://json.schemastore.org/dtool-dataset-metadata-1.0.json", + "title": "DToolDataset", + "description": "Schema for metadata attached to a dtool dataset", + "type": "object", + "properties": { + "uuid": { + "type": "string", + "format": "uuid" + }, + "base_uri": { + "type": "string" + }, + "uri": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "readme": { + "anyOf": [ + { "type": "string" }, + { + "type": "object", + "additionalProperties": true + } + ] + }, + "manifest": { + "type": "object", + "properties": { + "items": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "hash": { + "type": "string" + }, + "relpath": { + "type": "string" + }, + "size_in_bytes": { + "type": "integer" + }, + "utc_timestamp": { + "type": "number" + } + } + } + }, + "hash_function": { + "type": "string" + }, + "dtoolcore_version": { + "type": "string" + } + } + }, + "creator_username": { + "type": "string" + }, + "frozen_at": { + "anyOf": [{ "type": "string" }, { "type": "number" }] + }, + "created_at": { + "anyOf": [{ "type": "string" }, { "type": "number" }] + }, + "annotations": { + "type": "object" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "number_of_items": { + "type": "integer" + }, + "size_in_bytes": { + "type": "integer" + } + } +} diff --git a/src/test/dtool-dataset-metadata-1.0/dtool-dataset-metadata-1.0.json b/src/test/dtool-dataset-metadata-1.0/dtool-dataset-metadata-1.0.json new file mode 100644 index 00000000000..cdf8bd7c5ba --- /dev/null +++ b/src/test/dtool-dataset-metadata-1.0/dtool-dataset-metadata-1.0.json @@ -0,0 +1,28 @@ +{ + "annotations": { + "software": "bowtie2" + }, + "base_uri": "s3://snow-white", + "creator_username": "olssont", + "frozen_at": "1536238185.881941", + "manifest": { + "dtoolcore_version": "3.7.0", + "hash_function": "md5sum_hexdigest", + "items": { + "e4cc3a7dc281c3d89ed4553293c4b4b110dc9bf3": { + "hash": "d89117c9da2cc34586e183017cb14851", + "relpath": "U00096.3.rev.1.bt2", + "size_in_bytes": 5741810, + "utc_timestamp": 1536832115.0 + } + } + }, + "name": "my-dataset", + "number_of_items": 1, + "readme": "---\ndescription: test dataset", + "size_in_bytes": 5741810, + "tags": ["rnaseq"], + "type": "dataset", + "uri": "s3://snow-white/af6727bf-29c7-43dd-b42f-a5d7ede28337", + "uuid": "af6727bf-29c7-43dd-b42f-a5d7ede28337" +}