From d577a306f9a73eb5c783084d38f790fa3e7432b7 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 26 May 2021 08:41:07 +0000 Subject: [PATCH] inputs/files: extract metadata schema Make the schema more readable by extracting the metadata definition. --- inputs/org.osbuild.files | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/inputs/org.osbuild.files b/inputs/org.osbuild.files index 5d2d2e9b..ef75ac3f 100755 --- a/inputs/org.osbuild.files +++ b/inputs/org.osbuild.files @@ -24,6 +24,18 @@ from osbuild.objectstore import StoreClient SCHEMA = r""" "additionalProperties": false, +"definitions": { + "metadata": { + "description": "Additional metadata to forward to the stage", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^\\w+[.]{1}\\w+$": { + "additionalProperties": false + } + } + } +}, "required": ["type", "origin", "references"], "properties": { "type": { @@ -50,16 +62,7 @@ SCHEMA = r""" "type": "object", "additionalProperties": false, "properties": { - "metadata": { - "description": "Additinal metadata to forward to the stage", - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^\\w+[.]{1}\\w+$": { - "additionalProperties": false - } - } - } + "metadata": {"$ref": "#/definitions/metadata"} } } } @@ -91,7 +94,6 @@ def main(): json.dump({"error": e.output}, sys.stdout) return 1 - reply = { "path": output, "data": {