niccolox

niccolox

Seeking feedback exploring ash_json_api_wrapper

hello

last couple of days I have been exploring the ash_json_api_wrapper in a ecommerce store app I am building and I looking for feedback on the design and intent of this library

I see its experimental, and has no docs, and I think I have an ok working knowledge of it, I added an array type and a description type, the later I think its a kludge.

I am working against the Ecommerce API 3.0 from API Deck which based on a quick search seems reasonable Ecommerce API - Apideck

questions:

  1. anyone else using ash_json_api_wrapper in research or development or production?
  2. is the intent to be a way to interact with a JSON API endpoint? i.e. generate a Resource based on an JSON API and then interact with that API sending and receiving?
  3. how should I handle schemas that dont have endpoints? i.e. components.schemas.EcommerceOrderLineItem doesnt have a path in the Ecommerce API?

https://github.com/Devekko-Dev/devekko.store/blob/d10eb1919909feff1e1b8bbc0e2664699a54de45/store/lib/mix/ecommerce_api.ex#L26

my goal is to use the Ecommerce API from API Deck to build Ash Resources Domains JSON and GraphSQL and then integrate this with Next JS Commerce app in the same repo

the data in my Ash Ecommerce store than can be synced via API Deck into other platforms such as Shopify etc

First Post!

zachdaniel

zachdaniel

Creator of Ash
  1. I’ve only experimented with it, but I’d love to see it stretch its wings, and as soon as I have need of it I’ll be pushing its limits again.
  2. Yep! Thats right.
  3. If they don’t have endpoints then you are likely looking for embedded resources, the :map type, or a fully custom type.

Most Liked

niccolox

niccolox

Ok. Wrangling json schemas is not my favorite thing but if it can become a richer tool it can be a very powerful tool to build an integration project

zachdaniel

zachdaniel

Creator of Ash

It’s been a while since I’ve looked at that code but IIRC that is the path in the response that the resource in question can be found. like if you got a response like %{data: [%{"id" => 1}, %{"id" => 2}]} then entity_path would be something like data.

niccolox

niccolox

pushed some notes to my blog

Last Post!

niccolox

niccolox

splitting out the ash_json_gen_ecommerce_api to accompany my fork of ash_json_api_wrapper

my idea is to make an easily installable ash json gen package that consume the Ecommerce API and creates a Resource.

I have a closed sourced proprietary app which I want to use these apps in also

soon I want to expand

these are all personal self-funded projects, huge time constraints, so bear with me, I’ve done professional coding customer work, this ain’t that.

https://github.com/Devekko-Dev/devekko.store
https://github.com/Devekko-Dev/ash_json_gen_ecommerce_api
https://github.com/Devekko-Dev/ash_json_api_wrapper

Where Next?

Popular in Questions Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
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
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31525 112
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
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
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New