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?

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

  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.

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

1 Like

followup

whats "entity_path \"#{config[:entity_path]}\"" in relation to the OpenAPI JSON spec?

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.

1 Like

pushed some notes to my blog

1 Like

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.

1 Like