Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

array_push() expects parameter 1 to be array #624

Closed
JohannCarfantan opened this issue Dec 6, 2018 · 0 comments
Closed

array_push() expects parameter 1 to be array #624

JohannCarfantan opened this issue Dec 6, 2018 · 0 comments

Comments

@JohannCarfantan
Copy link

JohannCarfantan commented Dec 6, 2018

Hi,

I have a problem using swagger-php in a Laravel project. I have this problem since my migration from Swagger-PHP 2.x to Swagger-PHP 3.x. The thing is that i'm not able to tell where and why this problem happends.

When I execute this command
vendor/zircote/swagger-php/bin/openapi app --format json -o storage/api-docs/test.json --debug
This is what i get

TypeError: array_push() expects parameter 1 to be array, string given in /home/project/vendor/zircote/swagger-php/src/Annotations/AbstractAnnotation.php:173 Stack trace: #0 /home/project/vendor/zircote/swagger-php/src/Annotations/AbstractAnnotation.php(173): array_push('/api', Object(OpenApi\Annotations\PathItem)) #1 /home/project/vendor/zircote/swagger-php/src/Annotations/AbstractAnnotation.php(127): OpenApi\Annotations\AbstractAnnotation->merge(Array) #2 /home/project/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(820): OpenApi\Annotations\AbstractAnnotation->__construct(Array) #3 /home/project/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(663): Doctrine\Common\Annotations\DocParser->Annotation() #4 /home/project/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(354): Doctrine\Common\Annotations\DocParser->Annotations() #5 /home/project/vendor/zircote/swagger-php/src/Analyser.php(104): Doctrine\Common\Annotations\DocParser->parse('/** \n * @OA\\Ope...', Object(OpenApi\Context)) #6 /home/project/vendor/zircote/swagger-php/src/StaticAnalyser.php(314): OpenApi\Analyser->fromComment('/** \n * @OA\\Ope...', Object(OpenApi\Context)) #7 /home/project/vendor/zircote/swagger-php/src/StaticAnalyser.php(134): OpenApi\StaticAnalyser->analyseComment(Object(OpenApi\Analysis), Object(OpenApi\Analyser), '/** \n * @OA\\Ope...', Object(OpenApi\Context)) #8 /home/project/vendor/zircote/swagger-php/src/StaticAnalyser.php(45): OpenApi\StaticAnalyser->fromTokens(Array, Object(OpenApi\Context)) #9 /home/project/vendor/zircote/swagger-php/src/functions.php(41): OpenApi\StaticAnalyser->fromFile('app/Http/Contro...') #10 /home/project/vendor/zircote/swagger-php/bin/openapi(223): OpenApi\scan(Array, Array) #11 {main}

I'm unable to link all my code, I'm just looking for a typical problem that produces the same error, that could help me.

Thanks :)

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

No branches or pull requests

1 participant