mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-03 14:10:56 +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>
16 lines
436 B
Modula-2
16 lines
436 B
Modula-2
module github.com/OpenAPITools/openapi-generator/samples/openapi3/client/petstore/go
|
|
|
|
go 1.16
|
|
|
|
replace go-petstore => ./go-petstore
|
|
|
|
require (
|
|
cloud.google.com/go/compute v1.20.1 // indirect
|
|
github.com/stretchr/testify v1.10.0
|
|
go-petstore v0.0.0-00010101000000-000000000000
|
|
golang.org/x/net v0.31.0 // indirect
|
|
golang.org/x/oauth2 v0.24.0
|
|
google.golang.org/protobuf v1.31.0 // indirect
|
|
gopkg.in/validator.v2 v2.0.1 // indirect
|
|
)
|