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

grape/swagger POST arrays with embedded params don't work correctly in the UI

Open pswenson opened this issue 10 years ago • 6 comments
trafficstars

code like this:

desc 'create new symptom'
    params do
      optional :id, type: Integer
      requires :reasonCode, type: String
      requires :lifeThreatening, type: Boolean
      requires :msp, type: Boolean
      optional :symptomNamesAttributes, type: Array, default: [] do
          requires :name, type: String
          requires :primary, type: Boolean, default: false
      end
  end
end
screen shot 2015-10-02 at 2 53 12 pm

The area of interest is the SymtomNamesAttributes.

First problem: you can only enter one symtomNamesAttributes despite it being declared as an array. Second (bigger problem): even though symtomNamesAttributes is marked as "optional", the UI makes it required because the nested names/primary fields are required.

Are these known issues? Is there a work around?

pswenson avatar Oct 02 '15 20:10 pswenson

Bump, I've also been trying to figure out how to pass arrays through grape swagger..

kriskohlstedt avatar Jan 05 '16 22:01 kriskohlstedt

Does SwaggerUI claim to support these at all?

dblock avatar Jan 06 '16 15:01 dblock

+1

NeMO84 avatar Feb 17 '16 22:02 NeMO84

status?

thedanielhanke avatar Aug 30 '17 17:08 thedanielhanke

204

LeFnord avatar Aug 30 '17 21:08 LeFnord

+1

lehug avatar Feb 28 '18 08:02 lehug