Skip to content

Commit

Permalink
Special-case codegen for 'CreateStreamOut'
Browse files Browse the repository at this point in the history
This works around a bug with the generated openapi code - some of
the generated code expects it to be a class (with a `from_dict` method)
  • Loading branch information
svix-aaron1011 committed Sep 17, 2024
1 parent 2503197 commit ca30345
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/templates/model.py.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% set class_name = model.class_info.name %}
{% if model.required_properties == [] and model.optional_properties == [] %}
# TODO - remove this special case when we fix the generated code for empty openapi structs
{% if model.required_properties == [] and model.optional_properties == [] and model.class_info.name != "CreateStreamOut" %}
from typing import Any, Dict, Type, TypeVar

T = TypeVar("T", bound="{{ class_name }}")
Expand Down

0 comments on commit ca30345

Please sign in to comment.