Skip to content

Commit

Permalink
Remove dead code; arrays are always inline
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Dec 19, 2023
1 parent b63b8ee commit a306d60
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/uapi/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,11 @@ def default_build_rules(cls) -> list[tuple[Predicate, BuildHook]]:
"""Set up the default build rules."""
from .attrschema import build_attrs_schema

def build_sequence_schema(type: Any, builder: SchemaBuilder) -> AnySchema:
arg = get_args(type)[0]
inner = builder.get_schema_for_type(arg)
if isinstance(inner, ArraySchema):
raise Exception("Nested arrays are unsupported.")
return ArraySchema(inner)

return [
(
cls.PYTHON_PRIMITIVES_TO_OPENAPI.__contains__,
lambda t, _: cls.PYTHON_PRIMITIVES_TO_OPENAPI[t],
),
(is_sequence, build_sequence_schema),
(has, build_attrs_schema),
]

Expand Down

0 comments on commit a306d60

Please sign in to comment.