Skip to content

Commit af84b71

Browse files
committed
fix(python-linter): regex pattern caused linter issues
Signed-off-by: Alexander Dahmen <[email protected]>
1 parent ec3ed8b commit af84b71

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

templates/python/model_oneof.mustache

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
2121
{{#composedSchemas.oneOf}}
2222
# data type: {{{dataType}}}
2323
{{#isString}}
24-
{{vendorExtensions.x-py-name}}: Optional[Annotated[{{{dataType}}}, Field(strict=True)]] = Field(default=None, description="{{{description}}}"{{#pattern}}, pattern=re.sub(r'^\/|\/$', '',"{{.}}"){{/pattern}})
24+
{{vendorExtensions.x-py-name}}: Optional[Annotated[{{{dataType}}}, Field(strict=True)]] = Field(default=None, description="{{{description}}}"{{#pattern}},
25+
# Workaround until upstream issues are fixed:
26+
# https://github.com/OpenAPITools/openapi-generator/issues/19034 from Jun 28, 2024
27+
# and https://github.com/OpenAPITools/openapi-generator/issues/19842 from Oct 11, 2024
28+
# Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-227
29+
pattern=re.sub(r'^\/|\/$', '',r"{{.}}"){{/pattern}})
2530
{{/isString}}
2631
{{^isString}}
2732
{{vendorExtensions.x-py-name}}: {{{vendorExtensions.x-py-typing}}}

0 commit comments

Comments
 (0)