Skip to content

module Athena::Framework::Controller::ValueResolvers #

This type includes all of the built-in resolvers that Athena uses to try and resolve an argument for a particular controller action parameter. They run in the following order:

  1. ATHR::QueryParameter (110) - Attempts to resolve a value from the ATH::Request query parameters.

  2. ATHR::Enum (105) - Attempts to resolve a value from ATH::Request#attributes into an enum member of the related type. Works well in conjunction with ART::Requirement::Enum.

  3. ATHR::Time (105) - Attempts to resolve a value from the request attributes into a ::Time instance, defaulting to RFC 3339. Format/location can be customized via the ATHA::MapTime annotation.

  4. ATHR::UUID (105) - Attempts to resolve a value from the request attributes into a ::UUID instance.

  5. ATHR::RequestBody (105) - If enabled, attempts to deserialize the request body into the type of the related parameter, running any validations, if any.

  6. ATHR::RequestAttribute (100) - Provides a value stored in ATH::Request#attributes if one with the same name as the action parameter exists.

  7. ATHR::Request (50) - Provides the current ATH::Request if the related parameter is typed as such.

  8. ATHR::DefaultValue (-100) - Provides the default value of the parameter if it has one, or nil if it is nilable.

See each resolver for more detailed information. Custom resolvers may also be defined. See ATHR::Interface for more information.