Skip to content

Commit 864a344

Browse files
authored
chore: bump go sdk generator to v7.24.0 (#288)
Update the Go-only openapi-generator-cli version from v7.22.0 to v7.24.0, python and java stay unchanged. The upstream go/client.mustache decode() function gained support for decoding into *io.Reader and *[]byte, carried over into our customized template. Upstream also changed the oneOf "no match" error message, which changed the generated AreaId models (iaas v1/v2/v2beta1) covered by the override mechanism. Updated their hashes in overrides.properties and adopted the improved message in the override files. Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent 95422c5 commit 864a344

8 files changed

Lines changed: 31 additions & 10 deletions

File tree

languages/golang/templates/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{! This template was customized to use the GenericOpenAPIError from the core module. See https://github.com/OpenAPITools/openapi-generator/blob/v7.22.0/modules/openapi-generator/src/main/resources/go/api.mustache for the original template }}
1+
{{! This template was customized to use the GenericOpenAPIError from the core module. See https://github.com/OpenAPITools/openapi-generator/blob/v7.24.0/modules/openapi-generator/src/main/resources/go/api.mustache for the original template }}
22
{{>partial_header}}
33
package {{packageName}}
44

languages/golang/templates/client.mustache

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{! This template was customized to support the custom configuration options from the core module. See https://github.com/OpenAPITools/openapi-generator/blob/v7.22.0/modules/openapi-generator/src/main/resources/go/client.mustache for the original template }}
1+
{{! This template was customized to support the custom configuration options from the core module. See https://github.com/OpenAPITools/openapi-generator/blob/v7.24.0/modules/openapi-generator/src/main/resources/go/client.mustache for the original template }}
22
{{>partial_header}}
33
package {{packageName}}
44

@@ -578,6 +578,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err
578578
*s = string(b)
579579
return nil
580580
}
581+
if r, ok := v.(*io.Reader); ok {
582+
*r = bytes.NewReader(b)
583+
return nil
584+
}
585+
// Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte.
586+
if p, ok := v.(*[]byte); ok {
587+
*p = b
588+
return nil
589+
}
581590
if f, ok := v.(*os.File); ok {
582591
f, err = os.CreateTemp("", "HttpClientFile")
583592
if err != nil {

languages/golang/templates/configuration.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{! This template was ENTIRELY overwritten to support the custom configuration type and options from the STACKIT SDK core module. See https://github.com/OpenAPITools/openapi-generator/blob/v7.22.0/modules/openapi-generator/src/main/resources/go/configuration.mustache for the original template }}
1+
{{! This template was ENTIRELY overwritten to support the custom configuration type and options from the STACKIT SDK core module. See https://github.com/OpenAPITools/openapi-generator/blob/v7.24.0/modules/openapi-generator/src/main/resources/go/configuration.mustache for the original template }}
22
{{>partial_header}}
33
package {{packageName}}
44

scripts/generate-sdk/generate-sdk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ case "${LANGUAGE}" in
5656
go)
5757
# When the GENERATOR_VERSION changes, migrate also the templates in templates/go
5858
# Renovate: datasource=github-tags depName=OpenAPITools/openapi-generator versioning=semver
59-
GENERATOR_VERSION="v7.22.0"
59+
GENERATOR_VERSION="v7.24.0"
6060
;;
6161
python)
6262
# When the GENERATOR_VERSION changes, migrate also the templates in templates/python

scripts/generators/overrides/go/iaas/v1api/v1api_model_area_id.go

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/generators/overrides/go/iaas/v2api/v2api_model_area_id.go

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/generators/overrides/go/iaas/v2beta1api/v2beta_model_area_id.go

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
iaasV2ApiAreaId.path=iaas/v2api/model_area_id.go
22
iaasV2ApiAreaId.replacementPath=iaas/v2api/v2api_model_area_id.go
3-
iaasV2ApiAreaId.hash=b7425456c4633b2e8c0a61e9ab3b579e
3+
iaasV2ApiAreaId.hash=fd8a0426a8aefa66a10e7bb81c1cceba
44

55
iaasV1ApiAreaId.path=iaas/v1api/model_area_id.go
66
iaasV1ApiAreaId.replacementPath=iaas/v1api/v1api_model_area_id.go
7-
iaasV1ApiAreaId.hash=a9d72364fec0794cab3b51f3680de584
7+
iaasV1ApiAreaId.hash=b5626b52f7d93e9e9e26d679075d7031
88

99
iaasV2BetaApiAreaId.path=iaas/v2beta1api/model_area_id.go
1010
iaasV2BetaApiAreaId.replacementPath=iaas/v2beta1api/v2beta_model_area_id.go
11-
iaasV2BetaApiAreaId.hash=13e1bd33ceb69aa6a43a89c51c5dbffa
11+
iaasV2BetaApiAreaId.hash=0e4f740cefba5981258cf15ecd995246

0 commit comments

Comments
 (0)