inputs/files: extract metadata schema

Make the schema more readable by extracting the metadata definition.
This commit is contained in:
Christian Kellner 2021-05-26 08:41:07 +00:00 committed by Tom Gundersen
parent 869efab578
commit d577a306f9

View file

@ -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": {