# `GracefulSerialization.Helpers`
[🔗](https://github.com/nshkrdotcom/dspex/blob/v0.11.0/lib/snakebridge_generated/helpers/graceful_serialization.ex#L5)

Helper wrappers for `graceful_serialization`.

# `dict_with_generator`

```elixir
@spec dict_with_generator(keyword()) :: {:ok, term()} | {:error, term()}
```

Return a dict containing a generator and a regular value.

# `dict_with_pattern`

```elixir
@spec dict_with_pattern(keyword()) :: {:ok, term()} | {:error, term()}
```

Return a dict containing a compiled regex pattern.

# `list_with_pattern`

```elixir
@spec list_with_pattern(keyword()) :: {:ok, term()} | {:error, term()}
```

Return a list containing a compiled regex pattern.

# `multiple_patterns`

```elixir
@spec multiple_patterns(keyword()) :: {:ok, term()} | {:error, term()}
```

Return a list with multiple compiled patterns at different positions.

# `nested_structure`

```elixir
@spec nested_structure(keyword()) :: {:ok, term()} | {:error, term()}
```

Return a deeply nested structure with a compiled pattern.

# `pattern_with_flags`

```elixir
@spec pattern_with_flags(keyword()) :: {:ok, term()} | {:error, term()}
```

Return a pattern compiled with flags to show flag preservation.

# `tuple_with_pattern`

```elixir
@spec tuple_with_pattern(keyword()) :: {:ok, term()} | {:error, term()}
```

Return a tuple containing a compiled pattern.

# `validation_configs`

```elixir
@spec validation_configs(keyword()) :: {:ok, term()} | {:error, term()}
```

Return a list of validation configurations with compiled regex patterns.

This is a real-world pattern: storing compiled patterns alongside metadata
for form validation, input parsing, API request validation, etc.

Expected behavior: The outer list and inner dicts should be preserved,
with only the 'pattern' field becoming a ref (re.Pattern is non-serializable).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
