grape-swagger
grape-swagger copied to clipboard
grape/swagger POST arrays with embedded params don't work correctly in the UI
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
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?
Bump, I've also been trying to figure out how to pass arrays through grape swagger..
Does SwaggerUI claim to support these at all?
+1
status?
204
+1