diff --git a/inst/schema/outpack/metadata.json b/inst/schema/outpack/metadata.json index 85fd1272..7488e413 100644 --- a/inst/schema/outpack/metadata.json +++ b/inst/schema/outpack/metadata.json @@ -60,7 +60,7 @@ "properties": { "path": { "description": "The path of the file", - "type": "string" + "$ref": "relative-path.json" }, "hash": { "$ref": "hash.json" @@ -88,17 +88,16 @@ }, "files": { "type": "array", - "minItems": 1, "items": { "type": "object", "properties": { "here": { "description": "The path of the file in this packet", - "type": "string" + "$ref": "relative-path.json" }, "there": { "description": "The path of the file within the upstream packet", - "type": "string" + "$ref": "relative-path.json" } }, "required": ["here", "there"] diff --git a/inst/schema/outpack/relative-path.json b/inst/schema/outpack/relative-path.json new file mode 100644 index 00000000..1c27adee --- /dev/null +++ b/inst/schema/outpack/relative-path.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "File path", + "description": "A relative cross-platform file path", + "version": "0.1.1", + + "type": "string", + "pattern": "^([^<>:\"/\\\\|?*\\x00-\\x1f]+/)*[^<>:\"/\\\\|?*\\x00-\\x1f]+$" +}