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

PHP client - Package in sub folder triggers a composer installation error #57

Open
csmMike opened this issue May 27, 2024 · 3 comments
Open

Comments

@csmMike
Copy link

csmMike commented May 27, 2024

When attempting to install the PHP client using Composer, an error is encountered indicating that no packages can be found in the repo, despite adding the repo URL to the composer.json file, as per the README instructions, and running composer install, the same error persists.

The PHP client package is located in a subfolder named php-client, but Composer does not seem to support packages in subfolders, limiting the installation process.

How could it be solved?

@csmMike
Copy link
Author

csmMike commented Jun 1, 2024

I circumvented the problem by generating the api using openapi generator based on the schema.yml file.
Then I pushed the composer package into a repo of mine.
The installation went fine, there was a bit of trickery with compose.json, but that's on my ignorance of composer.
I managed to test the FilesApi endpoint, filesList(), and everything went smoothly.

As of now, I will update the package, by regenerating the apis, each time the schema.yml file in this repo changes.
A bit of a hack, but at least I can start testing out things. :)

@paddatrapper
Copy link
Contributor

It would seem we need to host the PHP library in its own repo for composer to see it properly. It shouldn't be impossible, but does need some reworking of the generation code

@csmMike
Copy link
Author

csmMike commented Jun 9, 2024

This action could be used just after the 'test' step in the php-client.yml workflow
It can even be remade easily I think, but this action seems to be quite popular
To proceed with this solution we need the php-client and a private token to have the correct permission
Additionally, the php-client/README.md should reflect the new repo url to ease the composer installation

Maybe I can try it out first to save you all some time?
I think I could temporarily fork this repo, make the steps I described above and see what happens

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

2 participants