You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.
We have quite a few query parameters that are shared across many routes, so it makes a lot of sense for us to share as much as we can there. I've tried a few different routes, but my metaprogramming-fu does not seem to be up to the challenge. Is this possible or am I just doing it wrong?
Here's what I've attempted so far:
# Shared parametersdefshared_list_paramsdoquotedoparameter:timeframe,:array,[description: "Timeframe array or duration string.",example: "24:hours"]parameter:page,:number,[optional: true,default: 1,example: 1]parameter:order_by,:string,[description: "Value to order the results by",default: "negative_impact"]parameter:order_direction,:string,[members: ["asc","desc"]]parameter:limit,:number,[default: 100]endendapi:GET,"/v1/something"dotitle"List somethings"description"Returns a whole lot of something"# Attempt 1unquote(shared_list_params())# Attempt 2Code.eval_quoted(shared_list_params())end
Neither of these blew up, but they didn't work, either. Any ideas on how to achieve something like this while using the api macro?
The text was updated successfully, but these errors were encountered:
I did some experimenting and found a way to do it, but not without changing the original api/2 macro. Please have a look at PR #24 and let me know what you think.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We have quite a few query parameters that are shared across many routes, so it makes a lot of sense for us to share as much as we can there. I've tried a few different routes, but my metaprogramming-fu does not seem to be up to the challenge. Is this possible or am I just doing it wrong?
Here's what I've attempted so far:
Neither of these blew up, but they didn't work, either. Any ideas on how to achieve something like this while using the
api
macro?The text was updated successfully, but these errors were encountered: