contributte / apitte

:wrench: An opinionated and enjoyable API framework based on Nette Framework. Supporting content negotiation, debugging, middlewares, attributes, annotations and loving openapi/swagger.
https://contributte.org/packages/contributte/apitte/
MIT License
61 stars 36 forks source link

Controller::setOpenApi() TypeError (array vs. string) #101

Closed Vlczech closed 5 years ago

Vlczech commented 5 years ago
TypeError
Argument 1 passed to Apitte\Core\Schema\Builder\Controller\Controller::setOpenApi() must be of the type array, string given, called in P:\xampp\htdocs\vian_sensingapi\protected\vendor\apitte\core\src\DI\Loader\DoctrineAnnotationLoader.php on line 157
File: ...\Schema\Builder\Controller\Controller.php:149
146:        /**
147:         * @param mixed[] $openApi
148:         */
149:        public function setOpenApi(array $openApi): void
150:        {
151:            $this->openApi = $openApi;
152:        }
153:    

Commit 4bf882f709c871c1233dc6344114e0c04a583a4f was the last corect.

mabar commented 5 years ago

@OpenApi annotations were not working at all before https://github.com/apitte/core/commit/57ff0f8cca5d2bcd51a00c2e012875a3dda3d1ce

Should be fixed by https://github.com/apitte/core/commit/94985d9edabe3e88b1bf27031ffe35da84e712dc, try it please

Vlczech commented 5 years ago

It seemed, that it works for me with 4bf882f, but I didn't test it in depth.

Your fix 94985d9 fixed the previous error for me.