Gets the primary key field name(s) for a resource.
Parameters
resource- The Ash resource module
Returns
List of primary key field names (as atoms).
Examples
iex> Config.primary_key(MyApp.Post)
[:id]
Reads the Ash and AshJsonApi metadata used during spec generation.
AshJsonApi is optional. Plain Ash resources keep their Elixir field names,
filters and sorting remain enabled, and domains without AshJsonApi.Domain
contribute no routes. Invalid resource or domain modules still raise through
Ash's introspection APIs so configuration mistakes are visible early.
Gets the default fields to include in responses for a resource.
Checks whether filter schemas should be auto-derived for a resource.
Checks whether sort schemas should be auto-derived for a resource.
Gets all resources in a domain.
Gets the JSON:API routes for a domain.
Gets the OpenAPI tag for a domain.
Gets the operation grouping strategy for a domain.
Gets the available relationship includes for a resource.
Returns the JSON:API argument name for an action argument.
Returns the JSON:API field name for a resource field.
Gets the primary key field name(s) for a resource.
Gets the public attributes for a resource.
Gets a specific relationship for a resource by name.
Gets the relationships for a resource.
Gets a specific action for a resource by name.
Gets the actions for a resource.
Returns the PascalCase display name for a resource, used to build schema and tag names.
Gets the JSON:API type name for a resource.
Gets the route prefix for a domain.
Returns whether a field should be exposed in JSON:API output and specs.
Gets the default fields to include in responses for a resource.
If configured, responses will only include the specified fields unless the client requests additional fields via sparse fieldsets.
resource - The Ash resource module List of field names (as atoms) or nil for all fields.
iex> Config.default_fields(MyApp.Post)
[:id, :title, :body]
iex> Config.default_fields(MyApp.Comment)
nil
Checks whether filter schemas should be auto-derived for a resource.
When enabled, the OpenAPI generator will create detailed filter parameter schemas based on the resource's attributes.
resource - The Ash resource moduleBoolean indicating if filter derivation is enabled.
iex> Config.derive_filter?(MyApp.Post)
true
Checks whether sort schemas should be auto-derived for a resource.
When enabled, the OpenAPI generator will create sort parameter schemas listing all sortable fields.
resource - The Ash resource moduleBoolean indicating if sort derivation is enabled.
iex> Config.derive_sort?(MyApp.Post)
true
Gets all resources in a domain.
domain - The Ash domain moduleList of resource modules.
iex> Config.domain_resources(MyApp.Blog)
[MyApp.Post, MyApp.Comment, MyApp.Author]
Gets the JSON:API routes for a domain.
domain - The Ash domain moduleList of route structs.
Config.domain_routes(MyApp.Blog)
# => [%{type: :index, ...}, %{type: :get, ...}, ...]
Gets the OpenAPI tag for a domain.
Tags are used to group operations in OpenAPI documentation tools like Swagger UI.
domain - The Ash domain module The tag name as a string, or nil if not configured.
iex> Config.domain_tag(MyApp.Blog)
"Blog"
Gets the operation grouping strategy for a domain.
Determines how operations are grouped in the OpenAPI spec.
domain - The Ash domain module The grouping strategy atom (e.g., :resource, :domain), or nil.
iex> Config.group_by(MyApp.Blog)
:resource
Gets the available relationship includes for a resource.
Defines which relationships can be included via the include
query parameter. Returns nil if not configured.
resource - The Ash resource module List of includable relationship paths, or nil if not configured.
iex> Config.includes(MyApp.Post)
[:author, :comments, "comments.author"]
Returns the JSON:API argument name for an action argument.
Applies the resource's argument_names mapping when the resource uses
AshJsonApi.Resource; otherwise falls back to the atom/string name.
Returns the JSON:API field name for a resource field.
Applies the resource's field_names mapping when the resource uses
AshJsonApi.Resource; otherwise falls back to the atom/string name.
Gets the primary key field name(s) for a resource.
resource - The Ash resource moduleList of primary key field names (as atoms).
iex> Config.primary_key(MyApp.Post)
[:id]
Gets the public attributes for a resource.
Returns only attributes marked public? true, which are the ones
that belong in OpenAPI schemas.
resource - The Ash resource moduleList of attribute structs.
Gets a specific relationship for a resource by name.
resource - The Ash resource modulename - The relationship name (atom) The relationship struct or nil if not found.
Gets the relationships for a resource.
resource - The Ash resource moduleList of relationship structs.
Gets a specific action for a resource by name.
resource - The Ash resource moduleaction_name - The action name (atom) The action struct or nil if not found.
Gets the actions for a resource.
resource - The Ash resource moduleList of action structs.
Returns the PascalCase display name for a resource, used to build schema and tag names.
Derives from the resource's declared JSON:API type when present — so a
deeply nested module like MyApp.Reconciliation.State with
type "reconciliation-state" names its schemas ReconciliationState*
instead of the ambiguous State*. Falls back to the module's short name
when no type is declared.
iex> AshOaskit.Config.resource_display_name(MyApp.Blog.Post)
"Post"
Gets the JSON:API type name for a resource.
The type is used in JSON:API responses as the type field and in
route generation. If not explicitly configured, defaults to the
underscored resource module name.
resource - The Ash resource moduleThe JSON:API type as a string.
iex> Config.resource_type(MyApp.BlogPost)
"blog_post"
iex> Config.resource_type(MyApp.User)
"user"
Gets the route prefix for a domain.
The prefix is prepended to all resource routes in the domain.
domain - The Ash domain moduleThe route prefix as a string (empty string if not configured).
iex> Config.route_prefix(MyApp.Blog)
"/api/v1"
iex> Config.route_prefix(MyApp.Admin)
"/admin"
Returns whether a field should be exposed in JSON:API output and specs.
Applies hide_fields/show_fields for AshJsonApi resources and defaults
to true for plain Ash resources.