I am using Apipie gem for documentation. I have created all the documentation which are basics but I am stuck in one api which is create api but finding the contact with query params. The code is below
def create
@account = Account.find_by(name: params[:name])
@user = @account.users.find_by(role: 'owner')
@contact = @user.contacts.find_by(email: contact_params[:email])
if @contact.present?
@contact.update(contact_params)
else
@contact = @user.contacts.new(contact_params)
@contact.save
end
render json: @contact, status: :ok
rescue StandardError => e
render json: { error: e.message }, status: :unprocessable_entity
end
def contact_params
params.require(:contact).permit(:first_name, :last_name, :email)
end
and the url of this api is http://localhost:3000/contacts?name=scott
.
How can i make documentation of this api using Apipie Gem