Skip to content

Commit

Permalink
patch missing schema fields to generate correct json schema structure…
Browse files Browse the repository at this point in the history
… for resource objects as objects in a list #152
  • Loading branch information
jh-RLI committed Oct 22, 2024
1 parent e3bf2ea commit 23c55b9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions metadata/v20/build_source/scripts/resolve_schema_refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,14 @@ def resolve_top_level_properties(schema, registry, base_uri):
resources = {}
for _k, _v in resolved_value["items"].items():
if isinstance(_v, dict):
resources.update(_v)
for element in _v.values():
resources.update(element)
resolved_properties[prop] = resolved_value
resolved_properties[prop]["items"] = resources
# Patch the missing keys
resolved_properties[prop]["items"] = {
"type": "object",
"properties": {**resources},
}

else:
resolved_properties[prop] = resolved_value
Expand Down

0 comments on commit 23c55b9

Please sign in to comment.