Sha256: c075ef124a4747217d8cdee5401025ff9064a3b87dd01ba1ddccfbb24ae92e64

Contents?: true

Size: 470 Bytes

Versions: 1

Compression:

Stored size: 470 Bytes

Contents

require 'grape'
require 'grape-swagger'

class DummyApi < Grape::API

  format :json
  version 'v1.0', using: :path, vendor: :dummyco

  prefix 'api'

  resource "petstore" do


  	desc "welcomes the user to the pet store"
  	get do
  		body("Welcome to the petstore!")
  	end


    params do
      requires :dog_type, type: String
    end
    
  	desc "buys a dog from the petstore"
  	post ":dog_type" do
  		"Thanks for buying a #{params[:dog_type]}"
  	end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
insta_swag-0.1.1 spec/support/dummy_api.rb