diff --git a/.generator/src/generator/templates/model_simple.j2 b/.generator/src/generator/templates/model_simple.j2 index 565702a2080..815298cf35f 100644 --- a/.generator/src/generator/templates/model_simple.j2 +++ b/.generator/src/generator/templates/model_simple.j2 @@ -378,6 +378,8 @@ func (o *{{ name }}) UnmarshalJSON(bytes []byte) (err error) { {%- for attr, schema in model.get("properties", {}).items() %} delete(additionalProperties, "{{ attr }}") {%- endfor %} + } else { + return err } {%- endif %}