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

AstonJ
Are there any Elixir or Erlang libraries that help with this? I’ve been thinking how streaming services like twitch have exploded recentl...
New
ricklove
I was just introduced to Elixir and Phoenix. I was told about the 2 million websocket test that was done 2 years ago. From my research, t...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
sergio
There’s a new TIOBE index report that came out that shows Elixir is still not in the top 50 used languages. It also goes on to call Elix...
New
PragTob
Hey everyone, this has been brewing in my head some time and it came up again while reading Adopting Elixir. GenServers, supervisors et...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New

Other popular topics Top

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
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

We're in Beta

About us Mission Statement