Skip to content

Commit c23e0ec

Browse files
committed
add comment workaround within the template
1 parent 51d7bf7 commit c23e0ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

templates/go/model_oneof.mustache

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ 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+
{{! Ticket: STACKITSDK-225 PR: https://github.com/stackitcloud/stackit-sdk-generator/pull/182 }}
5960
{{#composedSchemas.oneOf}}
6061
{{#dataType}}
6162
// try to unmarshal data into {{#lambda.type-to-name}}{{{.}}}{{/lambda.type-to-name}}
@@ -78,6 +79,7 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error {
7879

7980
{{/dataType}}
8081
{{/composedSchemas.oneOf}}
82+
{{! END - Workaround in case oneOf contains enums and strings. The enum value would match with both. }}
8183
if match > 1 { // more than 1 match
8284
// reset to nil
8385
{{#oneOf}}

0 commit comments

Comments
 (0)