Skip to content

How to define a param object in a component? #72

@sixties

Description

@sixties

Hi,

Maybe a stupid newbie question: I defined an action like this:

api :show, 'return a single instance' do
   param :path, :id, Integer, :req, range: { gt: 0}, desc: 'instance id'
   resp 200, 'success', :json, data: :Instance
end`

I wanted to define the param in a component such as:

components do
  param :instance_id => [
      :path, id: {type: Integer}, desc: 'test']
end

Which gives a syntax error. Could you please give me a hint, how to define a path parameter in a components section?

Best regards,

Udo Eisenbarth

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions