When generating schema for some sum types the type field is set as object. But that seems to be incorrect. E.g.
data Foo = Bar | Baz Int
deriving (Show, Generic)
instance ToSchema Foo where
declareNamedSchema = genericDeclareNamedSchema defaultSchemaOptions{sumEncoding = UntaggedValue}
However, encoding of the Foo is clearly not an object.
This also confuses SwaggerUI.
Schema is valid
But generated example is not
If one removes type field example becomes valid
Unrelated change, but looks like there was a redundant dependency on network package. Few types from it were imported, but neither used nor re-exported.
When generating schema for some sum types the
type
field is set asobject
. But that seems to be incorrect. E.g.will have schema
However, encoding of the Foo is clearly not an object.
This also confuses SwaggerUI.
Schema is valid
But generated example is not
If one removes
type
field example becomes validUnrelated change, but looks like there was a redundant dependency on
network
package. Few types from it were imported, but neither used nor re-exported.