mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 20:50:55 +00:00
* chore(go): add failing test for JSON marshalling Adds a small schema (FruitJuice) which contains a required gmFruit, which inherits using AnyOf. This fails to correctly marshal as JSON. * fix(go): use non-pointer receiver for JSON marshal In the case of a required anyOf property, JSON marshalling would has been incorrect. Required properties are not nullable, and thus always use value receivers. For the single case of anyOf models, a pointer receiver was used for MarshalJSON. All other instances of json marshalling use value receivers. This change is simply to use a value receiver instead of a pointer receiver in the template for `MarshalJSON` on anyOf models. --------- Co-authored-by: Per Hallgren <perhallgren@users.noreply.github.com>