AshPhoenixGenApi.Debug (ash_phoenix_gen_api v1.1.0)

Copy Markdown View Source

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.

Summary

Functions

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

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

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

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

Functions

inspect_domain_sources(domain)

@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(resource)

@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.