shankardevy

shankardevy

`mix phx.routes` equivalent for AshJsonApi?

I know there is AshJsonApi.Resource.Info.routes/2 as documented here to get the list of routes per resource inside a single domain. However, wouldn’t it be nice to have a mix task like mix phx.routes to list all routes available for all domains?

Would something like this is in the roadmap for the Ash team and would you be willing to accept a PR?

Most Liked

zachdaniel

zachdaniel

Creator of Ash

I’m happy to accept a PR for this, but one thing to keep in mind is that it will need to support two modes potentially, one based off of phoenix and one based off of plug. Alternatively, we could just have it fail if phoenix is not available.

For a template on how to do this, you can see the mix ash_authentication_phoenix.routes code. Just remember to conditionally compile it based on the presence of Phoenix, since ash_json_api does not depend on phoenix.

https://github.com/team-alembic/ash_authentication_phoenix/blob/main/lib/mix/tasks/ash_authentication.phoenix.routes.ex

Where Next?

Popular in Discussions Top

ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New
rower687
Hi all, I’ve been reading a lot about the “let it crash” term and how supervising processes and the whole messaging passing make an elixi...
New
acrolink
How does the two languages compare when it comes to server side application development? Any experiences or ideas? Thank you.
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement