Skip to content

Commit e5355cd

Browse files
Default to string when we don't understand the format. (#2588)
1 parent 79ae956 commit e5355cd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

.generator/src/generator/formatter.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,9 @@ def simple_type(schema, render_nullable=False, render_new=False):
152152
return {
153153
"date": "time.Time" if not nullable else f"{nullable_prefix}Time",
154154
"date-time": "time.Time" if not nullable else f"{nullable_prefix}Time",
155-
"email": "string" if not nullable else f"{nullable_prefix}String",
156155
"binary": "_io.Reader",
157156
"uuid": "uuid.UUID" if not nullable else f"{nullable_prefix}String",
158-
None: "string" if not nullable else f"{nullable_prefix}String",
159-
}[type_format]
157+
}.get(type_format, "string" if not nullable else f"{nullable_prefix}String")
160158
if type_name == "boolean":
161159
return "bool" if not nullable else f"{nullable_prefix}Bool"
162160

0 commit comments

Comments
 (0)