inputs/files: extract sources definition
Make the main portion of the schema more readable by extracting the two possible reference definitions.
This commit is contained in:
parent
d577a306f9
commit
2b19e534e6
1 changed files with 24 additions and 19 deletions
|
|
@ -34,6 +34,26 @@ SCHEMA = r"""
|
|||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"plain-ref": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"object-ref": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"minProperties": 1,
|
||||
"patternProperties": {
|
||||
".*": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"metadata": {"$ref": "#/definitions/metadata"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["type", "origin", "references"],
|
||||
|
|
@ -48,25 +68,10 @@ SCHEMA = r"""
|
|||
},
|
||||
"references": {
|
||||
"description": "Checksums of files to use as files input",
|
||||
"oneOf": [{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}, {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"minProperties": 1,
|
||||
"patternProperties": {
|
||||
".*": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"metadata": {"$ref": "#/definitions/metadata"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
"oneOf": [
|
||||
{"$ref": "#/definitions/plain-ref"},
|
||||
{"$ref": "#/definitions/object-ref"}
|
||||
]
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue