You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One issue we encountered was when two routes are pointing to the same Controller method.
E.g.
GET /api/posts
GET /api/users/{user-id}/posts
Which point to controller
class API::PostsController
def index
posts = policy_scope(Post)
posts = posts.where(user_id: params[:user_id]) if params[:user_id].present?
render posts.as_json
end
end
And API Docs
class API::PostsDoc < ApiDoc
route_base 'api/posts'
api :index, "Get Posts" do
..
end
end
So far we haven't found a way to write the definition that generates the correct docs for both endpoints at the same time
The text was updated successfully, but these errors were encountered:
One issue we encountered was when two routes are pointing to the same Controller method.
E.g.
Which point to controller
And API Docs
So far we haven't found a way to write the definition that generates the correct docs for both endpoints at the same time
The text was updated successfully, but these errors were encountered: