@@ -448,12 +448,14 @@ instance {-# OVERLAPPING #-} Constructor c => GToSchema (C1 c U1) where
448448instance (Selector s, GToSchema f) => GToSchema (C1 c (S1 s f)) where
449449 gdeclareNamedSchema opts _ s
450450 | unwrapUnaryRecords opts = fieldSchema
451− | otherwise = do
452− (_, schema) <- recordSchema
451+ | otherwise =
453452 case schema ^. schemaItems of
454453 Just (SwaggerItemsArray [_]) -> fieldSchema
455− _ -> pure (unnamed schema)
454+ _ -> do
455+ declare defs
456+ return (unnamed schema)
456457 where
458+ (defs, (_, schema)) = runDeclare recordSchema mempty
457459 recordSchema = gdeclareNamedSchema opts (Proxy :: Proxy (S1 s f)) s
458460 fieldSchema = gdeclareNamedSchema opts (Proxy :: Proxy f) s
459461