From 5ab11b11c8165325fc000069b8866f1ade23cb91 Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Mon, 8 Jul 2024 14:51:41 +0100 Subject: [PATCH] Update schema --- DESCRIPTION | 2 +- inst/schema/outpack/README.md | 4 ++-- inst/schema/outpack/git.json | 3 ++- inst/schema/outpack/metadata.json | 7 +++---- inst/schema/outpack/relative-path.json | 9 +++++++++ scripts/update_schemas | 2 +- 6 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 inst/schema/outpack/relative-path.json diff --git a/DESCRIPTION b/DESCRIPTION index 6e0f3737..6ecb1305 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: orderly2 Title: Orderly Next Generation -Version: 1.99.19 +Version: 1.99.20 Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"), email = "rich.fitzjohn@gmail.com"), person("Robert", "Ashton", role = "aut"), diff --git a/inst/schema/outpack/README.md b/inst/schema/outpack/README.md index 852daa76..c39e265b 100644 --- a/inst/schema/outpack/README.md +++ b/inst/schema/outpack/README.md @@ -1,8 +1,8 @@ # Imported from outpack * Schema version 0.1.1 -* Imported on 2023-08-17 10:00:21.068664 -* From outpack @ ba2bb5bf44a56b3c0ce78128fa419375df109fe3 (main) +* Imported on 2024-07-08 14:51:14.625617 +* From outpack @ bff49fcc97711b1c3c2540bb18f784c7a5bf76c2 (git-null) Do not make changes to files here, they will be overwritten Run ./scripts/update_schemas to update diff --git a/inst/schema/outpack/git.json b/inst/schema/outpack/git.json index 5fe44ac2..9161b1fc 100644 --- a/inst/schema/outpack/git.json +++ b/inst/schema/outpack/git.json @@ -19,5 +19,6 @@ "type": "string" } } - } + }, + "required": ["url", "sha", "branch"] } 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]+$" +} diff --git a/scripts/update_schemas b/scripts/update_schemas index fbe98de7..4316cc9f 100755 --- a/scripts/update_schemas +++ b/scripts/update_schemas @@ -2,7 +2,7 @@ root <- here::here() -outpack_branch <- "main" +outpack_branch <- "git-null" url <- "https://github.com/mrc-ide/outpack" tmp <- tempfile() repo <- gert::git_clone(url, tmp, outpack_branch)