---
title: "SchemaGenerationSettings"
canonical_url: "https://www.nutrient.io/api/csharp/settings/vision/schema-generation-settings/"
md_url: "https://www.nutrient.io/api/csharp/settings/vision/schema-generation-settings.md"
last_updated: "2026-10-08T08:55:57.713Z"
description: "Settings for SchemaGeneration. Values fall back through three levels: document → SDK → built-in default."
---

Settings for SchemaGeneration. Values fall back through three levels: document → SDK → built-in default. Writes target the document only when set on a document's settings, otherwise the SDK globally when set on SdkSettings.

```csharp

using Nutrient;

```

The SDK creates this class through factory methods or other SDK objects.

## Properties

### AllowDiscriminatedUnions

```csharp

public bool AllowDiscriminatedUnions { get; set; }

```

Gets or sets the value of AllowDiscriminatedUnions. Reads walk the chain: Document override → SDK override → Default. Writes go to document level if available, otherwise SDK level.

**Type:** `bool`

### AllowEnums

```csharp

public bool AllowEnums { get; set; }

```

Gets or sets the value of AllowEnums. Reads walk the chain: Document override → SDK override → Default. Writes go to document level if available, otherwise SDK level.

**Type:** `bool`

### AllowNullable

```csharp

public bool AllowNullable { get; set; }

```

Gets or sets the value of AllowNullable. Reads walk the chain: Document override → SDK override → Default. Writes go to document level if available, otherwise SDK level.

**Type:** `bool`

### AllowPatterns

```csharp

public bool AllowPatterns { get; set; }

```

Gets or sets the value of AllowPatterns. Reads walk the chain: Document override → SDK override → Default. Writes go to document level if available, otherwise SDK level.

**Type:** `bool`

### AllowStringFormats

```csharp

public bool AllowStringFormats { get; set; }

```

Gets or sets the value of AllowStringFormats. Reads walk the chain: Document override → SDK override → Default. Writes go to document level if available, otherwise SDK level.

**Type:** `bool`

### Compatibility

```csharp

public SchemaCompatibility Compatibility { get; set; }

```

Gets or sets the value of Compatibility. Reads walk the chain: Document override → SDK override → Default. Writes go to document level if available, otherwise SDK level.

**Type:** [`SchemaCompatibility`](/api/csharp/enums/schema-compatibility/)

### IncludeConstraints

```csharp

public bool IncludeConstraints { get; set; }

```

Gets or sets the value of IncludeConstraints. Reads walk the chain: Document override → SDK override → Default. Writes go to document level if available, otherwise SDK level.

**Type:** `bool`

### MaxArrayItems

```csharp

public int MaxArrayItems { get; set; }

```

Gets or sets the value of MaxArrayItems. Reads walk the chain: Document override → SDK override → Default. Writes go to document level if available, otherwise SDK level.

**Type:** `int`

### MaxFields

```csharp

public int MaxFields { get; set; }

```

Gets or sets the value of MaxFields. Reads walk the chain: Document override → SDK override → Default. Writes go to document level if available, otherwise SDK level.

**Type:** `int`

### MaxNestingDepth

```csharp

public int MaxNestingDepth { get; set; }

```

Gets or sets the value of MaxNestingDepth. Reads walk the chain: Document override → SDK override → Default. Writes go to document level if available, otherwise SDK level.

**Type:** `int`

### MaxRetries

```csharp

public int MaxRetries { get; set; }

```

Gets or sets the value of MaxRetries. Reads walk the chain: Document override → SDK override → Default. Writes go to document level if available, otherwise SDK level.

**Type:** `int`

## Resource management

```csharp

public void Dispose()

```

`SchemaGenerationSettings` implements `IDisposable`. Call `Dispose()` or use a C# `using` declaration to release its native handle right away. If you don't, the handle is released when the object is garbage collected.

---

## Related pages

- [Vision](/api/csharp/settings/vision.md)
- [Document Classification Settings](/api/csharp/settings/vision/document-classification-settings.md)
- [Document Split Settings](/api/csharp/settings/vision/document-split-settings.md)
- [Extract Settings](/api/csharp/settings/vision/extract-settings.md)
- [Parse Settings](/api/csharp/settings/vision/parse-settings.md)
- [Vision Settings](/api/csharp/settings/vision/vision-settings.md)

