Ash FrameworkAF
Ash Framework8mo ago
9 replies
Abhishek Tripathi

ash json api

I added ash json api via

mix igniter.install ash_json_api

and updated resource via

mix ash.patch.extend AshTableVue.GoldenDataset.Resources.Question json_api

Then Added routes to domain.

in my router.ex
 

  pipeline :api do
    plug :accepts, ["json"]
    plug :load_from_bearer
    plug :set_actor, :user
    plug AshAuthentication.Strategy.ApiKey.Plug, resource: AshTableVue.Accounts.User
  end

  scope "/api/json" do
    pipe_through [:api]

    forward "/swaggerui", OpenApiSpex.Plug.SwaggerUI,
      path: "/api/json/open_api",
      default_model_expand_depth: 4

    forward "/", AshTableVueWeb.AshJsonApiRouter
  end


Now, when i go to http://localhost:4000/api/json/swaggerui, it shows unauthorized! Why?

I've logged in via /sign-in route already.
Was this page helpful?