# `AshPhoenixGenApi.Debug`
[🔗](https://github.com/ohhi-vn/ash_phoenix_gen_api/blob/v1.1.0/lib/ash_phoenix_gen_api/debug.ex#L1)

Debugging utilities for AshPhoenixGenApi DSL source annotations.

Provides functions to inspect where DSL elements are defined in source code,
which is useful for debugging configuration issues or building developer tools.

## Usage

    # Inspect source locations for a resource's gen_api config
    AshPhoenixGenApi.Debug.inspect_resource_sources(MyApp.Chat.DirectMessage)

    # Inspect source locations for a domain's gen_api config
    AshPhoenixGenApi.Debug.inspect_domain_sources(MyApp.Chat)

Source annotations require `debug_info` to be enabled (the default in dev/test).
They are not available in production or `.exs` scripts unless explicitly enabled.

# `inspect_domain_sources`

```elixir
@spec inspect_domain_sources(module()) :: map() | {:error, :no_gen_api}
```

Inspects source locations for a domain's `gen_api` DSL section.

Returns a map with section, option, and entity locations.

# `inspect_resource_sources`

```elixir
@spec inspect_resource_sources(module()) :: map() | {:error, :no_gen_api}
```

Inspects source locations for a resource's `gen_api` DSL section.

Returns a map with section, option, and entity locations.

# `print_domain_sources`

```elixir
@spec print_domain_sources(module()) :: :ok
```

Prints a human-readable summary of DSL source locations for a domain.

# `print_resource_sources`

```elixir
@spec print_resource_sources(module()) :: :ok
```

Prints a human-readable summary of DSL source locations for a resource.

---

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