From 8c409c7de08dc7796731d453963c4263353cab93 Mon Sep 17 00:00:00 2001 From: Alexander Dahmen Date: Mon, 18 Aug 2025 08:54:43 +0200 Subject: [PATCH] chore(python): Fix workaround message which was displayed all the time Signed-off-by: Alexander Dahmen --- templates/python/model_oneof.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/python/model_oneof.mustache b/templates/python/model_oneof.mustache index 2b59108..699bf02 100644 --- a/templates/python/model_oneof.mustache +++ b/templates/python/model_oneof.mustache @@ -20,17 +20,17 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} """ {{#composedSchemas.oneOf}} # data type: {{{dataType}}} + {{#isString}} # BEGIN of the workaround until upstream issues are fixed: # https://github.com/OpenAPITools/openapi-generator/issues/19034 from Jun 28, 2024 # and https://github.com/OpenAPITools/openapi-generator/issues/19842 from Oct 11, 2024 # Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-227 - {{#isString}} {{vendorExtensions.x-py-name}}: Optional[Annotated[{{{dataType}}}, Field(strict=True)]] = Field(default=None, description="{{{description}}}"{{#pattern}}, pattern=re.sub(r'^\/|\/$', '',r"{{.}}"){{/pattern}}) + # END of the workaround {{/isString}} {{^isString}} {{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}} {{/isString}} - # END of the workaround {{/composedSchemas.oneOf}} actual_instance: Optional[Union[{{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}]] = None one_of_schemas: Set[str] = { {{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}} }