@@ -448,12 +448,14 @@ instance {-# OVERLAPPING #-} Constructor c => GToSchema (C1 c U1) where
448instance (Selector s, GToSchema f) => GToSchema (C1 c (S1 s f)) where
448instance (Selector s, GToSchema f) => GToSchema (C1 c (S1 s f)) where
449 gdeclareNamedSchema opts _ s
449 gdeclareNamedSchema opts _ s
450 | unwrapUnaryRecords opts = fieldSchema
450 | unwrapUnaryRecords opts = fieldSchema
451− | otherwise = do
451+ | otherwise =
452− (_, schema) <- recordSchema
453 case schema ^. schemaItems of
452 case schema ^. schemaItems of
454 Just (SwaggerItemsArray [_]) -> fieldSchema
453 Just (SwaggerItemsArray [_]) -> fieldSchema
455− _ -> pure (unnamed schema)
456+ return (unnamed schema)
458+ (defs, (_, schema)) = runDeclare recordSchema mempty
457 recordSchema = gdeclareNamedSchema opts (Proxy :: Proxy (S1 s f)) s
459 recordSchema = gdeclareNamedSchema opts (Proxy :: Proxy (S1 s f)) s
458 fieldSchema = gdeclareNamedSchema opts (Proxy :: Proxy f) s
460 fieldSchema = gdeclareNamedSchema opts (Proxy :: Proxy f) s