diff --git a/templates/go/model_oneof.mustache b/templates/go/model_oneof.mustache index 8366014..649b03d 100644 --- a/templates/go/model_oneof.mustache +++ b/templates/go/model_oneof.mustache @@ -123,7 +123,7 @@ func (src {{classname}}) MarshalJSON() ([]byte, error) { } {{/oneOf}} - return nil, nil // no data in oneOf schemas + return []byte("{}"), nil // no data in oneOf schemas => empty JSON object } // Get the actual instance