swagger-api / swagger-api/swagger-codegen

PHP Code generation - Why forcing Guzzle usage

Open
#11,725 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Recently I opened an issue on a project which uses the swagger-codegen to generate a PHP lib.

Related issues/PRs

https://github.com/sendinblue/APIv3-php-library/issues/194

Suggest a fix/enhancement

This is my original message :

Recently I had to use the SendinBlue API in my PHP project.
What was my surprise when I saw I had to download Guzzle (via composer of course).
I already developped a small lib to comunicate with another API and I didn't force the lib user to use a specific implementation for the http calls. The user have to give an implementation of a PSR ClientInterface.
This way, the user can use whatever implementation he wants.
Furthermore, if I have to call x differents API and each lib chose a different implementation for the HTTP calls, the project downloads a lot of different projects to do the same thing …

Could you change that and offer to the users (other devs) the choice ? Whatever lib wich respect PSR-7, 17 and 18 ?

In my PHP lib project, for exemple, I use HTTPlug (https://docs.php-http.org/en/latest/httplug/introduction.html) and I don't need to specify a specific lib.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the PHP generator templates and dependency declarations that introduce Guzzle, then review the linked SendinBlue issue and the PSR-7, PSR-17, and PSR-18 requirements. Done means generated clients offer a compatible HTTP-client choice instead of forcing Guzzle, with the resulting dependency behavior documented and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.