inputs/files: extract metadata schema
Make the schema more readable by extracting the metadata definition.
This commit is contained in:
parent
869efab578
commit
d577a306f9
1 changed files with 13 additions and 11 deletions
|
|
@ -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": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue