docusign / docusign-esign-php-client

The Official Docusign PHP Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
198 stars 123 forks source link

Issue with Composer v2 #123

Closed tcov189 closed 3 years ago

tcov189 commented 3 years ago

After installing or updating with Composer 2, classes under the \DocuDign\eSign namespace cannot be found.

Reverting back to Composer 1 resolves issue.

Please update to make compatible with Composer 2.

LarryKlugerDS commented 3 years ago

Thank you for the problem report! I have filed internal request DCM-4854.

tcov189 commented 3 years ago

@LarryKlugerDS Hello, I was wondering if there was any update or time frame on this?

LarryKlugerDS commented 3 years ago

I have now escalated the issue. I will also bring it up in the VP's meeting next week. A Pull Request would be very helpful for moving this along. Thank you

tcov189 commented 3 years ago

I think what needs to happen to get this to work is that the files that contain multiple class definitions need to be abstracted out into their own class files.

I was going to make a PR for this, but I noticed that all of the files are generated by swagger-codegen and wasn't sure if that would just recreate the single file multi class definitions again.

LarryKlugerDS commented 3 years ago

Aah, got it. You're correct about Swagger CodeGen, we'll need to update its templates. So please don't do a PR. Thanks for the investigation.

LarryKlugerDS commented 3 years ago

Please connect with me on LinkedIn: https://linkedin.com/in/larrykluger

tcov189 commented 3 years ago

@LarryKlugerDS I was wondering if there were any updates on this?

LarryKlugerDS commented 3 years ago

Update: I will be emphasizing the importance of this issue in a meeting with the VP and engineering group this evening

LarryKlugerDS commented 3 years ago

Related information from https://github.com/docusign/code-examples-php/issues/14 From https://github.com/DylanGD

Please remove hirak/prestissimo dependency, composer v2 does not support it and it's not more really necessary. Alt Text

LarryKlugerDS commented 3 years ago

The engineer working on this issue updated his composer to v2 and then loaded https://github.com/docusign/code-examples-php

He reports that there were no problems.

Can you provide a concise reproducible test case that fails with Composer v2? Thank you!

tcov189 commented 3 years ago

@LarryKlugerDS I created a fork and added a test file https://github.com/tcov189/docusign-php-client/blob/composer-2-compatibility/test.php

Let me know if this is not a sufficient test and I can expand.

LarryKlugerDS commented 3 years ago

Great, thank you @tcov189 .

dbbrahmbhatt commented 3 years ago

Hi @tcov189 thanks for reporting the issue and sending the test file. Our swagger-spec is common for all the languages and classes are generated based on the swagger-spec. Changing it might create problem in all other SDKs. So the best solution to resolve this issue is to add the classmap in autoload of your composer.json file.

"autoload": { "classmap": [ "vendor/docusign/esign-client/src" ] }

I tested that with the test file you provided and it is working fine for both the versions of composer. Let us know if you still face the issue.

tcov189 commented 3 years ago

I will try this and let you know if I still get an issue. Thanks for looking into it.

LarryKlugerDS commented 3 years ago

Hi @tcov189 -- sounds like the suggestion solved the problem. I will ask the engineer to update the Readme file. /Larry