mpociot / laravel-apidoc-generator

Laravel API Documentation Generator
https://beyondco.de/docs/laravel-apidoc-generator/
MIT License
3.43k stars 614 forks source link

Pass an array of value as bodyParam in example response #753

Closed vittorio-c closed 4 years ago

vittorio-c commented 4 years ago

Hello,

I would like to use an array of values as Example in doc, and use the values inside the Example array to generate a response (I use Generating response automatically) .

Here is what I've tried so far :

@bodyParam company_sector_ids.* array The IDs of the company sectors - up to three. Example: [410, 411]
class MyClass
{
  // code
}

Here, I would like to build my json payload with the integer 410 and 411 as values of the array company_sector_ids.

But it does not work : I get that kind of payload, where the array is surrounded with quotes :

 "company_sector_ids": [
     "[410, 411]"
],

So my application does not accept the request (because it's expecting an array of INT, not a string into an array), and I get errors in my example response.

Is that something I can achieve? If so, how ?

Thank you very much for all the work so far. Great package.

vittorio-c commented 4 years ago

Hi, gentle update :-)

Still haven't found a solution to my problem.

Any ideas ?

shalvah commented 4 years ago

Hi. I'm no longer on this project, and I doubt I'd being maintained. I maintain Scribe now, where your issue has been fixed. https://github.com/knuckleswtf/scribe

vittorio-c commented 4 years ago

Okay, thank you @shalvah for your response. Yes, I will go and take a look at your new project.