Skip to content

Commit 55c85c2

Browse files
zimeonahankinson
authored andcommitted
JSON schema for 0.1 (#241)
1 parent 71d2ebb commit 55c85c2

File tree

2 files changed

+74
-74
lines changed

2 files changed

+74
-74
lines changed

0.1/spec/inventory_schema.json

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -34,44 +34,44 @@
3434
"enum": [ "Object" ]
3535
},
3636
"versions": {
37-
"type" : "array",
38-
"uniqueItems": true,
39-
"items": {
40-
"type": "object",
41-
"additionalProperties": false,
42-
"properties": {
43-
"created": {
44-
"type": "string",
45-
"format": "date-time"
46-
},
47-
"message": {
48-
"type": "string"
49-
},
50-
"state": {
51-
"$ref": "#/definitions/digests_to_files"
52-
},
53-
"type": {
54-
"description": "Seems that using `const` would be nicer but that doesn't seem to work with Python jsonschema",
55-
"enum": [ "Version" ]
56-
},
57-
"user": {
58-
"type": "object",
59-
"additionalProperties": false,
60-
"properties": {
61-
"address": {
62-
"type": "string"
63-
},
64-
"name": {
65-
"type": "string"
66-
}
37+
"description": "Each key is a version directory name with version objects as values",
38+
"type" : "object",
39+
"additionalProperties": false,
40+
"patternProperties": {
41+
"^v\\d+$": {
42+
"type": "object",
43+
"additionalProperties": false,
44+
"properties": {
45+
"created": {
46+
"type": "string",
47+
"format": "date-time"
48+
},
49+
"message": {
50+
"type": "string"
51+
},
52+
"state": {
53+
"$ref": "#/definitions/digests_to_files"
54+
},
55+
"type": {
56+
"description": "Seems that using `const` would be nicer but that doesn't seem to work with Python jsonschema",
57+
"enum": [ "Version" ]
6758
},
68-
"required": [ "address", "name" ]
59+
"user": {
60+
"type": "object",
61+
"additionalProperties": false,
62+
"properties": {
63+
"address": {
64+
"type": "string"
65+
},
66+
"name": {
67+
"type": "string"
68+
}
69+
},
70+
"required": [ "address", "name" ]
71+
}
6972
},
70-
"version": {
71-
"$ref": "#/definitions/version_directory"
72-
}
73-
},
74-
"required": [ "created", "message", "state", "type", "user", "version" ]
73+
"required": [ "created", "message", "state", "type", "user" ]
74+
}
7575
}
7676
}
7777
},

draft/spec/inventory_schema.json

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://ocfl.io/draft/spec/inventory_schema.json",
2+
"$id": "https://ocfl.io/0.1/spec/inventory_schema.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"title": "JSON Schema for OCFL Inventory files",
55
"description": "Note that this schema does not permit extension keys, only keys defined in the OCFL Specification are admitted.",
@@ -34,44 +34,44 @@
3434
"enum": [ "Object" ]
3535
},
3636
"versions": {
37-
"type" : "array",
38-
"uniqueItems": true,
39-
"items": {
40-
"type": "object",
41-
"additionalProperties": false,
42-
"properties": {
43-
"created": {
44-
"type": "string",
45-
"format": "date-time"
46-
},
47-
"message": {
48-
"type": "string"
49-
},
50-
"state": {
51-
"$ref": "#/definitions/digests_to_files"
52-
},
53-
"type": {
54-
"description": "Seems that using `const` would be nicer but that doesn't seem to work with Python jsonschema",
55-
"enum": [ "Version" ]
56-
},
57-
"user": {
58-
"type": "object",
59-
"additionalProperties": false,
60-
"properties": {
61-
"address": {
62-
"type": "string"
63-
},
64-
"name": {
65-
"type": "string"
66-
}
37+
"description": "Each key is a version directory name with version objects as values",
38+
"type" : "object",
39+
"additionalProperties": false,
40+
"patternProperties": {
41+
"^v\\d+$": {
42+
"type": "object",
43+
"additionalProperties": false,
44+
"properties": {
45+
"created": {
46+
"type": "string",
47+
"format": "date-time"
48+
},
49+
"message": {
50+
"type": "string"
51+
},
52+
"state": {
53+
"$ref": "#/definitions/digests_to_files"
54+
},
55+
"type": {
56+
"description": "Seems that using `const` would be nicer but that doesn't seem to work with Python jsonschema",
57+
"enum": [ "Version" ]
6758
},
68-
"required": [ "address", "name" ]
59+
"user": {
60+
"type": "object",
61+
"additionalProperties": false,
62+
"properties": {
63+
"address": {
64+
"type": "string"
65+
},
66+
"name": {
67+
"type": "string"
68+
}
69+
},
70+
"required": [ "address", "name" ]
71+
}
6972
},
70-
"version": {
71-
"$ref": "#/definitions/version_directory"
72-
}
73-
},
74-
"required": [ "created", "message", "state", "type", "user", "version" ]
73+
"required": [ "created", "message", "state", "type", "user" ]
74+
}
7575
}
7676
}
7777
},
@@ -98,4 +98,4 @@
9898
"pattern": "^v\\d+$"
9999
}
100100
}
101-
}
101+
}

0 commit comments

Comments
 (0)