Skip to content

Commit 5334014

Browse files
authored
[go] Fix panic from marshalling Nil NullableTime (#17772)
1 parent ba4e5ef commit 5334014

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

modules/openapi-generator/src/main/resources/go/utils.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ func NewNullableTime(val *time.Time) *NullableTime {
311311
}
312312

313313
func (v NullableTime) MarshalJSON() ([]byte, error) {
314-
return v.value.MarshalJSON()
314+
return json.Marshal(v.value)
315315
}
316316

317317
func (v *NullableTime) UnmarshalJSON(src []byte) error {

samples/client/echo_api/go/utils.go

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

samples/client/petstore/go/go-petstore/utils.go

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

samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/utils.go

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

samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/utils.go

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

samples/openapi3/client/petstore/go/go-petstore/utils.go

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

0 commit comments

Comments
 (0)