for the following schema:
{
"allOf": [
{
"allOf": [
{
"oneOf": [
{ "properties": { "a_foo_one_of_0": { "type": "string" } } },
{ "properties": { "a_foo_one_of_1": { "type": "string" } } }
]
}
]
},
{ "properties": { "a_foo": { "type": "string" } } }
]
}
this gets generated:
// Foo defines model for Foo.
type Foo struct {
AFoo *string `json:"a_foo,omitempty"`
}
when it should generate (helper functions omitted for brevity):
// Foo defines model for Foo.
type Foo struct {
AFoo *string `json:"a_foo,omitempty"`
union json.RawMessage
}
// Foo0 defines model for .
type Foo0 struct {
AFooOneOf0 *string `json:"a_foo_one_of_0,omitempty"`
}
// Foo1 defines model for .
type Foo1 struct {
AFooOneOf1 *string `json:"a_foo_one_of_1,omitempty"`
}
note that above has been fixed (and unit test added) in #1904
for the following schema:
{ "allOf": [ { "allOf": [ { "oneOf": [ { "properties": { "a_foo_one_of_0": { "type": "string" } } }, { "properties": { "a_foo_one_of_1": { "type": "string" } } } ] } ] }, { "properties": { "a_foo": { "type": "string" } } } ] }this gets generated:
when it should generate (helper functions omitted for brevity):
note that above has been fixed (and unit test added) in #1904