diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache index c0c498db14e0..20cb13d541b1 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache @@ -13,7 +13,7 @@ func {{{.}}}As{{classname}}(v *{{{.}}}) {{classname}} { {{/oneOf}} -// Unmarshl JSON data into one of the pointers in the struct +// Unmarshal JSON data into one of the pointers in the struct func (dst *{{classname}}) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -53,8 +53,8 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { } } -// Marshl data from the first non-nil pointers in the struct to JSON -func (src *{{classname}}) MarshalJSON() ([]byte, error) { +// Marshal data from the first non-nil pointers in the struct to JSON +func (src {{classname}}) MarshalJSON() ([]byte, error) { {{#oneOf}} if src.{{{.}}} != nil { return json.Marshal(&src.{{{.}}}) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go index b50054da7ff1..ec7e137f352e 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go @@ -31,7 +31,7 @@ func BananaAsFruit(v *Banana) Fruit { } -// Unmarshl JSON data into one of the pointers in the struct +// Unmarshal JSON data into one of the pointers in the struct func (dst *Fruit) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -74,8 +74,8 @@ func (dst *Fruit) UnmarshalJSON(data []byte) error { } } -// Marshl data from the first non-nil pointers in the struct to JSON -func (src *Fruit) MarshalJSON() ([]byte, error) { +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Fruit) MarshalJSON() ([]byte, error) { if src.Apple != nil { return json.Marshal(&src.Apple) } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go index 41e7c2a5a180..b70da598b420 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go @@ -31,7 +31,7 @@ func BananaReqAsFruitReq(v *BananaReq) FruitReq { } -// Unmarshl JSON data into one of the pointers in the struct +// Unmarshal JSON data into one of the pointers in the struct func (dst *FruitReq) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -74,8 +74,8 @@ func (dst *FruitReq) UnmarshalJSON(data []byte) error { } } -// Marshl data from the first non-nil pointers in the struct to JSON -func (src *FruitReq) MarshalJSON() ([]byte, error) { +// Marshal data from the first non-nil pointers in the struct to JSON +func (src FruitReq) MarshalJSON() ([]byte, error) { if src.AppleReq != nil { return json.Marshal(&src.AppleReq) } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go index 77e8ee3e97c1..a3af711d6f39 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go @@ -31,7 +31,7 @@ func ZebraAsMammal(v *Zebra) Mammal { } -// Unmarshl JSON data into one of the pointers in the struct +// Unmarshal JSON data into one of the pointers in the struct func (dst *Mammal) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -74,8 +74,8 @@ func (dst *Mammal) UnmarshalJSON(data []byte) error { } } -// Marshl data from the first non-nil pointers in the struct to JSON -func (src *Mammal) MarshalJSON() ([]byte, error) { +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Mammal) MarshalJSON() ([]byte, error) { if src.Whale != nil { return json.Marshal(&src.Whale) }