Sending Array of string in grape API

702 views Asked by At

Using grape api, I try to send an array of string but I always have the response error, codes is not valid

In my model, I expose my field like this :

expose :code, documentation: { type: Array[String]}

And when I make my test, I pass

"code": [
      "037ffdb5-6901-404c-b152-8321a32aa397", "1762005c-8cf0-427d-b090-d354d6255eba"
    ],

When I check in my console, I have an array of string passed in my params :

=> ["037ffdb5-6901-404c-b152-8321a32aa397", "1762005c-8cf0-427d-b090-d354d6255eba"]

Is anyone having a clue why my params are not valid ?

0

There are 0 answers