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

Add support for except

Open ZeroInputCtrl opened this issue 9 years ago • 0 comments

In grape a new field was added for the values matcher called except in which you can pass in values that are not allowed to be entered for submission which can be found here. https://github.com/ruby-grape/grape/pull/1486 Currently through a normal curl call this works as expected but on the swagger side you can see here http://prntscr.com/ct2ime that the field is showing up as a blank drop-down. How we are currently using it is : requires :field, allow_blank: false, values: { except: -> { Model.all.map { |md| md&.assoc&.value } } , except_message: 'has a value that already exists' }

It would probably be nice to have in grape-swagger if the only thing that's passed through is 'except' the field generated should show up as a textbox instead of a drop down?

ZeroInputCtrl avatar Oct 12 '16 21:10 ZeroInputCtrl