@@ -201,14 +201,14 @@ instance {-# OVERLAPPABLE #-} GToSchema f => GToSchema (C1 c f) where
201-- | Single field constructor.
201-- | Single field constructor.
202instance (Selector s, GToSchema f) => GToSchema (C1 c (S1 s f)) where
202instance (Selector s, GToSchema f) => GToSchema (C1 c (S1 s f)) where
203 gtoNamedSchema opts _ s
203 gtoNamedSchema opts _ s
204− | unwrapUnaryRecords opts = unnamed fieldSchema
204+ | unwrapUnaryRecords opts = unnamed (snd fieldSchema)
205− | otherwise = unnamed $
205+ | otherwise =
206 case schema ^. schemaItems of
206 case schema ^. schemaItems of
207 Just (SchemaItemsArray [_]) -> fieldSchema
207 Just (SchemaItemsArray [_]) -> fieldSchema
208− _ -> schema
208+ _ -> unnamed schema
210 schema = gtoSchema opts (Proxy :: Proxy (S1 s f)) s
210 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
213gtoSchemaRef :: GToSchema f => SchemaOptions -> proxy f -> Referenced Schema
213gtoSchemaRef :: GToSchema f => SchemaOptions -> proxy f -> Referenced Schema
214gtoSchemaRef opts proxy = case gtoNamedSchema opts proxy mempty of
214gtoSchemaRef opts proxy = case gtoNamedSchema opts proxy mempty of