vyron's avatar
Level 1

integrate openapi-generated-cli libraries into laravel project

Hai, I'm new here and still learning, I have an external api package/library generated from the openapi-generated-cli and wnat to use it in my laravel project, how do I integrate it?

I just get this error:

Error: Class "OpenApi\Client\Model\LoginPostRequest" not found

0 likes
2 replies
Sinnbeck's avatar

Can you show the package? Did you install it with composer? Some code you can share?

vyron's avatar
Level 1

@Sinnbeck yes, I install it using composer and place the path in the autoload

this is a part of the code:

use OpenApi\Client\Api\AIVLoginApi; use OpenApi\Client\Api\TestApi; use OpenApi\Client\Model\AIVLoginPOSTRequest; use OpenApi\Client\Model\ContextInfo;

$loginPostRequest = new AIVLoginPOSTRequest();

and this in my composer.json file

"autoload": { "psr-4": { "App\": "app/", "Database\Factories\": "database/factories/", "Database\Seeders\": "database/seeders/", "OpenAPI\Client\": "lib/" } }, "autoload-dev": { "psr-4": { "Tests\": "tests/", "OpenAPI\Client\Test\": "test/" } },

Please or to participate in this conversation.