Open
Description
Consider an API endpoint which returns a different entity depending on the current user. Is it possible to specify those different return entities in Grape DSL? Something like the following?
desc 'Return user details' do
success Entities::BasicUser, Entities::FullUser
end
get 'users' do
if is_admin
present users, with: Entities::FullUser
else
present users, with: Entities::BasicUser
end
end