meta: support definitions in schema version 2
For schema version 2 of modules, the `definitions` node, as defined in the module itself, won't be at the `options` level but at the level of the `properties` node. Look for a `definitions` at that `properties` level and move it to the top, if found.
This commit is contained in:
parent
98a82ff47e
commit
a8fcda8348
1 changed files with 6 additions and 1 deletions
|
|
@ -338,7 +338,12 @@ class ModuleInfo:
|
|||
# the top level schema node, since the schema inside the
|
||||
# stages is written as-if they were the root node and
|
||||
# so are the references
|
||||
options = schema.get("properties", {}).get("options", {})
|
||||
props = schema.get("properties", {})
|
||||
if "definitions" in props:
|
||||
schema["definitions"] = props["definitions"]
|
||||
del props["definitions"]
|
||||
|
||||
options = props.get("options", {})
|
||||
if "definitions" in options:
|
||||
schema["definitions"] = options["definitions"]
|
||||
del options["definitions"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue