This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' } |