Sometimes I should use boolean value as value for discriminator field. Now when generating union methods for this type I get types errors
Example schema
ConfigHttp:
type: object
properties:
is_http:
type: boolean
enum: [true]
host:
type: string
port:
type: integer
ConfigSsh:
type: object
properties:
is_http:
type: boolean
enum: [false]
host:
type: string
key:
type: string
ConfigSchema:
oneOf:
- $ref: "#/components/schemas/ConfigHttp"
- $ref: "#/components/schemas/ConfigSsh"
discriminator:
propertyName: is_http
mapping:
false: "#/components/schemas/ConfigSsh"
true: "#/components/schemas/ConfigHttp"
In result I get method like this. "false" value is don't fit here
func (t *ConfigSchema) FromConfigSsh(v ConfigSsh) error {
v.IsHttp = "false"
b, err := json.Marshal(v)
t.union = b
return err
}
Sometimes I should use boolean value as value for discriminator field. Now when generating union methods for this type I get types errors
Example schema
In result I get method like this. "false" value is don't fit here