Skip to content

Commit 20e0dd5

Browse files
committed
add comment workaround within the template
1 parent 154a247 commit 20e0dd5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

templates/go/model_oneof.mustache

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error {
5454
{{/discriminator}}
5555
{{^discriminator}}
5656
match := 0
57-
{{! Workaround in case oneOf contains enums and strings. The enum value would match with both. }}
58-
{{! The workaround adds a regex check for the string (in case the api spec provides a regex) }}
57+
{{! BEGIN - Workaround in case oneOf contains enums and strings. The enum value would match with both. }}
58+
{{! This workaround adds a regex check for the string (in case the api spec provides a regex) }}
59+
// Workaround until upstream issue is fixed:
60+
// https://github.com/OpenAPITools/openapi-generator/issues/21751
61+
// Tracking issue on our side: https://jira.schwarz/browse/STACKITSDK-226
5962
{{#composedSchemas.oneOf}}
6063
{{#dataType}}
6164
// try to unmarshal data into {{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}}
@@ -78,6 +81,7 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error {
7881

7982
{{/dataType}}
8083
{{/composedSchemas.oneOf}}
84+
{{! END - Workaround in case oneOf contains enums and strings. The enum value would match with both. }}
8185
if match > 1 { // more than 1 match
8286
// reset to nil
8387
{{#oneOf}}

0 commit comments

Comments
 (0)