Skip to content

Instantly share code, notes, and snippets.

View kripz97's full-sized avatar

Kripa kripz97

View GitHub Profile
require "grape-swagger"
module Api
module V1
class Base < Grape::API
version "v1", using: :path
format :json
#...
add_swagger_documentation base_path: "/api", api_version: "v1", hide_documentation_path: true
end
end
desc "Api to post user details " do
failure [
[500, "something went wrong, please try again later", Entity::Status]
]
success Entity::Status
end
params do
requires :customer_email, type: String, allow_blank: false, email: true, desc: "Customer Email", documentation: { param_type: 'body' }