---
title: GenerationSchema
framework: foundationmodels
role: symbol
role_heading: Structure
path: foundationmodels/generationschema
---

# GenerationSchema

A type that describes the properties of an object and any guides on their values.

## Declaration

```swift
struct GenerationSchema
```

## Mentioned in

Generating Swift data structures with guided generation

## Overview

Overview Generation  schemas guide the output of a SystemLanguageModel to deterministically ensure the output is in the desired format.

## Topics

### Creating a generation schema

- [init(root:dependencies:)](foundationmodels/generationschema/init(root:dependencies:).md)
- [init(type:description:anyOf:)](foundationmodels/generationschema/init(type:description:anyof:).md)
- [init(type:description:properties:)](foundationmodels/generationschema/init(type:description:properties:).md)
- [init(type:description:representNilExplicitlyInGeneratedContent:properties:)](foundationmodels/generationschema/init(type:description:representnilexplicitlyingeneratedcontent:properties:).md)
- [GenerationSchema.Property](foundationmodels/generationschema/property.md)

### Errors

- [GenerationSchema.SchemaError](foundationmodels/generationschema/schemaerror.md)

## Relationships

### Conforms To

- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Structured output

- [Generating Swift data structures with guided generation](foundationmodels/generating-swift-data-structures-with-guided-generation.md)
- [Generable](foundationmodels/generable.md)
- [DynamicGenerationSchema](foundationmodels/dynamicgenerationschema.md)
- [GeneratedContent](foundationmodels/generatedcontent.md)
- [ConvertibleToGeneratedContent](foundationmodels/convertibletogeneratedcontent.md)
- [ConvertibleFromGeneratedContent](foundationmodels/convertiblefromgeneratedcontent.md)
