Skip to content

Commit 310ed10

Browse files
Revert schema changes
1 parent e8b627b commit 310ed10

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

linodecli/baked/util.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,7 @@ def _aggregate_schema_properties(
2323
properties = {}
2424
required = defaultdict(lambda: 0)
2525

26-
def _handle_schema(path: List[str], data: Dict[str, Any]):
27-
# We accept data as a dict here to prevent and parsing edge cases
28-
for i, entry in enumerate(data.get("oneOf", [])):
29-
_handle_schema(path + ["oneOf", i], entry)
30-
31-
for i, entry in enumerate(data.get("allOf", [])):
32-
_handle_schema(path + ["allOf", i], entry)
33-
34-
_schema = Schema(path, data, schema._root)
35-
26+
def _handle_schema(_schema: Schema):
3627
if _schema.properties is None:
3728
return
3829

@@ -46,7 +37,14 @@ def _handle_schema(path: List[str], data: Dict[str, Any]):
4637
for key in _schema.required:
4738
required[key] += 1
4839

49-
_handle_schema(schema.path, schema.raw_element)
40+
_handle_schema(schema)
41+
42+
one_of = schema.oneOf or []
43+
any_of = schema.anyOf or []
44+
45+
for entry in one_of + any_of:
46+
# pylint: disable=protected-access
47+
_handle_schema(Schema(schema.path, entry, schema._root))
5048

5149
return (
5250
properties,

0 commit comments

Comments
 (0)