@@ -201,6 +201,15 @@ inlineSchemas names = inlineSchemasWhen (`elem` names)
201inlineAllSchemas :: Data s => Definitions -> s -> s
201inlineAllSchemas :: Data s => Definitions -> s -> s
202inlineAllSchemas = inlineSchemasWhen (const True)
202inlineAllSchemas = inlineSchemasWhen (const True)
204+-- | Convert a type into a schema without references.
206+-- __WARNING:__ @'toInlinedSchema'@ will produce infinite schema
207+-- when inlining recursive schemas.
208+toInlinedSchema :: ToSchema a => proxy a -> Schema
209+toInlinedSchema proxy = inlineAllSchemas defs schema
211+ (defs, schema) = runDeclare (declareSchema proxy) mempty
204-- | Inline all /non-recursive/ schemas for which the definition
213-- | Inline all /non-recursive/ schemas for which the definition
205-- can be found in @'Definitions'@.
214-- can be found in @'Definitions'@.
206inlineNonRecursiveSchemas :: Data s => Definitions -> s -> s
215inlineNonRecursiveSchemas :: Data s => Definitions -> s -> s