Skip to content

fix: multidimensional array params#792

Open
regular-alves wants to merge 2 commits intompociot:masterfrom
regular-alves:adjustments
Open

fix: multidimensional array params#792
regular-alves wants to merge 2 commits intompociot:masterfrom
regular-alves:adjustments

Conversation

@regular-alves
Copy link

I found some errors in rendering multidimensional array params such as "param[with][array][]".
When I've tried to execute the command PHP artisan apidoc the following is shown:

ErrorException  : Array to string conversion (View: /path/to/application/vendor/mpociot/laravel-apidoc-generator/resources/views/partials/example-requests/php.blade.php) (View: /path/to/application/vendor/mpociot/laravel-apidoc-generator/resources/views/partials/example-requests/php.blade.php)
  at /path/to/application/vendor/mpociot/laravel-apidoc-generator/src/Tools/Utils.php:166
    162|                 } else {
    163|                     // Hash query param (eg filter[name]=john should become "filter[name]": "john")
    164|                     foreach ($value as $item => $itemValue) {
    165|                         $output .= str_repeat(" ", $spacesIndentation);
  > 166|                         $output .= "$quote$parameter" . "[$item]$quote$delimiter $quote$itemValue$quote,\n";
    167|                     }
    168|                 }
    169|             }
    170|         }
  Exception trace:
  1   Illuminate\View\Engines\CompilerEngine::handleViewException()
      /path/to/application/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php:45
  2   Mpociot\ApiDoc\Writing\Writer::Mpociot\ApiDoc\Writing\{closure}()
      [internal]:0

error on rendering of multidimensional array params such as "param[with][array][]"
@regular-alves regular-alves changed the title Adjustments fix: multidimensional array params Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant