Skip to content

Commit d01b72c

Browse files
authored
(fix): snippet templates for discriminated unions specify template_inputs (#3808)
1 parent bd16b09 commit d01b72c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

generators/python/sdk/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.9.3] - 2024-06-06
9+
10+
- Fix: Snippet templates for discrminated unions now specify the `template_input` property which is
11+
required to actually see snippets of instantiating discrminated unions.
12+
813
## [2.9.2] - 2024-06-06
914

1015
- Fix: downgrades mypy so we can run it over all our files without concern for their pydantic bug

generators/python/sdk/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.9.2
1+
2.9.3

generators/python/src/fern_python/snippet/snippet_template_factory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ def _get_discriminated_union_template(
445445
discriminant_field=union_declaration.discriminant.wire_value,
446446
template_string=f"{name}={self.TEMPLATE_SENTINEL}" if name is not None else f"{self.TEMPLATE_SENTINEL}",
447447
members=member_templates,
448+
template_input=PayloadInput(location="RELATIVE"),
448449
)
449450
)
450451

0 commit comments

Comments
 (0)