@@ -201,14 +201,14 @@ instance {-# OVERLAPPABLE #-} GToSchema f => GToSchema (C1 c f) where
201201-- | Single field constructor.
202202instance (Selector s, GToSchema f) => GToSchema (C1 c (S1 s f)) where
203203 gtoNamedSchema opts _ s
204− | unwrapUnaryRecords opts = unnamed fieldSchema
205− | otherwise = unnamed $
204+ | unwrapUnaryRecords opts = unnamed (snd fieldSchema)
205+ | otherwise =
206206 case schema ^. schemaItems of
207207 Just (SchemaItemsArray [_]) -> fieldSchema
208− _ -> schema
208+ _ -> unnamed schema
209209 where
210210 schema = gtoSchema opts (Proxy :: Proxy (S1 s f)) s
211− fieldSchema = gtoSchema opts (Proxy :: Proxy f) s
211+ fieldSchema = gtoNamedSchema opts (Proxy :: Proxy f) s
212212
213213gtoSchemaRef :: GToSchema f => SchemaOptions -> proxy f -> Referenced Schema
214214gtoSchemaRef opts proxy = case gtoNamedSchema opts proxy mempty of