OpenAPITools / OpenAPITools/openapi-generator

[REQ] [PHP] Add the ability to disable HTTP Errors in GuzzleHttp

Open
#19,440 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Is your feature request related to a problem? Please describe.

I am using an API that uses 500 error on some endpoints, it's specified in the API spec, but Guzzle still throws an exception when using that endpoint and it responds with 500 error.

Describe the solution you'd like

I'd like to be able to disable the "Http_errors" parameter in the guzzle client, so to prevent guzzle from throwing an exception on endpoints that will use the 500 error code.

Describe alternatives you've considered

Alternatively, it would be possible to make the client disable the "Http_errors" flag upon generating, when errors may be caught.

Additional context

https://github.com/AzuraCast/AzuraCast/issues/7396 this is the discussion I've had with the developers of the API.

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

Start by inspecting PHP client generation and how the generated Guzzle client handles the http_errors parameter. Confirm the desired behavior for endpoints that legitimately return HTTP 500 responses, then verify that generated clients can disable exception throwing for those responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.