Skip to content

Commit 810d30a

Browse files
authored
chore(python): Fix workaround message which was displayed all the time (#187)
Signed-off-by: Alexander Dahmen <[email protected]>
1 parent 5869628 commit 810d30a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/python/model_oneof.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
2020
"""
2121
{{#composedSchemas.oneOf}}
2222
# data type: {{{dataType}}}
23+
{{#isString}}
2324
# BEGIN of the workaround until upstream issues are fixed:
2425
# https://github.com/OpenAPITools/openapi-generator/issues/19034 from Jun 28, 2024
2526
# and https://github.com/OpenAPITools/openapi-generator/issues/19842 from Oct 11, 2024
2627
# Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-227
27-
{{#isString}}
2828
{{vendorExtensions.x-py-name}}: Optional[Annotated[{{{dataType}}}, Field(strict=True)]] = Field(default=None, description="{{{description}}}"{{#pattern}}, pattern=re.sub(r'^\/|\/$', '',r"{{.}}"){{/pattern}})
29+
# END of the workaround
2930
{{/isString}}
3031
{{^isString}}
3132
{{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}}
3233
{{/isString}}
33-
# END of the workaround
3434
{{/composedSchemas.oneOf}}
3535
actual_instance: Optional[Union[{{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}]] = None
3636
one_of_schemas: Set[str] = { {{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}} }

0 commit comments

Comments
 (0)