---
title: "Generable(description:)"
framework: foundationmodels
role: symbol
role_heading: Macro
path: "foundationmodels/generable(description:)"
---

# Generable(description:)

Conforms a type to Generable protocol.

## Declaration

```swift
@attached(extension, conformances: Generable, names: named(init(_:)), named(generatedContent)) @attached(member, names: arbitrary) macro Generable(description: String? = nil)
```

## Mentioned in

Generating Swift data structures with guided generation

## Overview

Overview You can apply this macro to structures and enumerations. @Generable struct NovelIdea {   @Guide(description: "A short title")   let title: String

@Guide(description: "A short subtitle for the novel")   let subtitle: String

@Guide(description: "The genre of the novel")   let genre: Genre }

@Generable enum Genre {   case fiction   case nonFiction } note: @Generable macro Generable(description:representNilExplicitlyInGeneratedContent:)

## See Also

### Creating a Generable type

- [Generable(description:representNilExplicitlyInGeneratedContent:)](foundationmodels/generable(description:representnilexplicitlyingeneratedcontent:).md)
- [Generable(name:description:representNilExplicitlyInGeneratedContent:)](foundationmodels/generable(name:description:representnilexplicitlyingeneratedcontent:).md)
