zero-rails_openapi
zero-rails_openapi copied to clipboard
How to define a param object in a component?
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
Something similar we have:
components do
query :UserIdQry => [:user_id, String, desc: 'the user identifier']
end
and
api :index, "Description.", id: 'getData' do
param_ref :UserIdQry
end