Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow action matcher strategy to be configured #821

Merged
merged 1 commit into from Feb 15, 2023

Conversation

PanosCodes
Copy link
Contributor

@PanosCodes PanosCodes commented Feb 14, 2023

Why

Currently we use the action param from the Request object to identify the correct action but there might some kind of logic, a method for example, that directs the request to a specific action.

How

Make the action matching strategy configurable by introducing Apipie.configuration.api_action_matcher that accepts a callable object.

Example

class SomeMatchingStrategy
  self.call(controller)
     #... Matching logic
  end
end

Apipie.configuration.api_action_matcher = SomeMatchingStrategy

@mathieujobin mathieujobin merged commit 3a020d8 into Apipie:master Feb 15, 2023
@PanosCodes PanosCodes deleted the custom-action-matcher branch March 28, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants