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
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"}
{:ash_json_api, "~> 1.0"}
Thank you in advance
Solution:
Just change the route that you serve the api at in your router
Jump to solution
3 Replies
ZachDaniel
ZachDaniel4mo ago
Instead of setting the prefix
Solution
ZachDaniel
ZachDaniel4mo ago
Just change the route that you serve the api at in your router
Shahryar
ShahryarOP4mo ago
Yes for now i leave this, but i think i can create 2 base_route like base_route "/v1/auth" and "/v2/auth" Thank you

Did you find this page helpful?