A definition of
"foo": {
"discriminator": "type",
"mapping": {
"a": {
"properties": {}
},
"b": {
"properties": {}
},
"c": {
"properties": {}
}
}
}
Generates a Go struct of
type Foo struct {
Type string
A FooA
B FooB
C FooC
}
Where it should be more acccurately be the same as an enum and look more like...
type FooTypeDiscriminator string
const (
FooTypeDiscriminatorA FooTypeDiscriminator = "a"
FooTypeDiscriminatorB FooTypeDiscriminator = "b"
FooTypeDiscriminatorC FooTypeDiscriminator = "c"
)
type Foo struct {
FooTypeDiscriminator string
A FooA
B FooB
C FooC
}
This would improve auto-completion and validation.