grape-swagger icon indicating copy to clipboard operation
grape-swagger copied to clipboard

params are not loading when defined both in desc block and separate params block

Open brahamshakti opened this issue 9 years ago • 2 comments

Desc block params are not loading when defined with separate params block, e.g.

desc "Create a User.", {
        headers: {'XAuthToken': {required: true}},
        params: Entities::UserEntity.documentation
}
params do
        optional :extra_parameter, type: String
end

In above case only extra_parameter and header field are visible. This worked well previously by showing all desc block params field with separate params block field.

This code works well by displaying header field with optional extra_parameter

desc "Create a User.", {
        headers: {'XAuthToken': {required: true}},
}
params do
        optional :extra_parameter, type: String
end

but below code only shows params field and not header field (I have removed extra param block)

desc "Create a User.", {
        headers: {'XAuthToken': {required: true}},
        params: Entities::UserEntity.documentation
}

I think this is a bug. What you guys think.

brahamshakti avatar Apr 25 '16 09:04 brahamshakti

@brahamshakti … think, these params should internally be added to route.[route_]params

LeFnord avatar Apr 30 '16 21:04 LeFnord

@brahamshakti … I investigated a bit and found no way to do it on grape-swagger side, cause it is a grape option for the desc block, see: desc.rb and we should not overwrite grape behaviour

LeFnord avatar Jul 05 '16 11:07 LeFnord