refactor: drop inline isinstance guard in type-list normalization

JSON Schema type arrays contain only strings, so type_mapping.get(entry,
entry) is sufficient and avoids an inline type guard.
This commit is contained in:
eeshsaxena 2026-08-03 19:47:11 +05:30
parent f1f2fff980
commit affd76499e

View file

@ -57,9 +57,7 @@ def normalize_json_schema_types(
# to mark a field nullable (e.g. ["STRING", "NULL"]). Without this
# branch those entries fall through to the generic list recursion,
# which leaves the bare strings uppercase.
normalized_schema[key] = [
type_mapping.get(entry, entry) if isinstance(entry, str) else entry for entry in value
]
normalized_schema[key] = [type_mapping.get(entry, entry) for entry in value]
elif key == "properties" and isinstance(value, dict):
# Recursively normalize properties
normalized_schema[key] = {