Ash FrameworkAF
Ash Framework6mo ago
5 replies
Shahryar

Prefix changes the Api path in SwaggerUi but Not Acceptable

Hi sorry, I set prefix "/api/v1" in my json_api and it is changed inside SwaggerUi to this prefix.
For example /api/v1/auth/sign-in like this
  json_api do
    prefix "/api/v1"
    log_errors? true

    routes do
      base_route "/auth", MishkaCms.Accounts.User do
        post :sign_in_with_password do
          route "/sign-in"

          metadata fn _subject, user, _request ->
            %{token: user.__metadata__.token}
          end
        end

But when i send from SwaggerUi and terminal it returns Not Acceptable
But if i use without prefix /api/json/auth//sign-in even i set it, it works

I am using

{:ash_json_api, "~> 1.0"}

Thank you in advance
Solution
Just change the route that you serve the api at in your router
Was this page helpful?