grape-entity: Array of primitives, i.e. strings?

602 views
Skip to first unread message

Gregor Melhorn

unread,
May 12, 2016, 2:50:34 PM5/12/16
to Grape Framework Discussion
Hi,

I just can't figure out how to declare an array of strings as an attribute in a grape-entity declaration, so I get back the correct swagger.json from grape swagger.

It is no problem in swagger, just can't figure out how grape-entity does it.

I suppose it should work like 


expose :images, documentation: {is_array: true, type: "string", desc: 'uuids of some images'}
 

but it doesn't work and will, depending on what I try, either ignore the 'array' or the string attribute type and will not nest the items hash below. It only works when using custom entity types.

What is the correct syntax to use?

Thank you, 

Gregor

Daniel Doubrovkine

unread,
May 13, 2016, 7:05:47 AM5/13/16
to ruby-...@googlegroups.com
I would write a small test in https://github.com/ruby-grape/grape-swagger-entity to reproduce this and we can try to address it there.


--
You received this message because you are subscribed to the Google Groups "Grape Framework Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-grape+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages