kira🌺
AEAsh Elixir
•Created by kira🌺 on 5/12/2025 in #showcase
hapësirë - quote collection with a simple API

7 replies
AEAsh Elixir
•Created by kira🌺 on 5/9/2025 in #support
open_api_spex spec declaration with ash_json_api
generated Open API spec has either some basic or
nil
descriptions, summaries, etc. open_api_spex
documentation suggests using macros like operation/2
to describe my API. i've searched ash_json_api
docs for some information but to no success. is there a way to do describe my domains' / resources' routes like so in ash_json_api
?10 replies
AEAsh Elixir
•Created by kira🌺 on 5/3/2025 in #support
`:read`ing random entry
meow! i'd like to ask a possibly dumb question. i am currently making an inspirational quotes API. i have a
/api/quote
endpoint with :random
action which pretty much speaks for itself - returns a random quote and its author
how should i correctly define my :random
action? i know how to fetch a random entry using Ecto from q in "table", order_by: fragment("RANDOM()"), limit: 1, select: q
. how would i do this in my action? i am using sqlite btw and here's my resource definition
i use quote's text as primary key in my db to eliminate duplicates and to add new quotes from CSV-s and other stuff w/ ease. and i guess i won't need ids for them in the near future
as you can see, i have language code in my table's name, that's because i have multiple tables with quotes in different languages. so i need to choose which table to query too...31 replies