Skip to content

[HttpFoundation] Add ProblemDetailsJsonResponse for HTTP APIs #61208

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

Open
wants to merge 10 commits into
base: 7.4
Choose a base branch
from

Conversation

abdellahrk
Copy link

@abdellahrk abdellahrk commented Jul 22, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
License MIT

This PR introduces the ProblemDetailJsonResponse which is an implementation of RFC 9457 to describe the specifics of a problem encountered:

{
  "type": "https://example.com/probs/out-of-credit",
  "title": "You do not have enough credit.",
  "detail": "Your current balance is 30, but that costs 50.",
  "instance": "/account/12345/msgs/abc",
  "balance": 30,
  "accounts": ["/account/12345", "/account/67890"]
}

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@abdellahrk abdellahrk force-pushed the feature/problem_detail_response branch from 2bbb577 to 7cecc40 Compare July 22, 2025 22:01
@abdellahrk
Copy link
Author

Thank you very much @smnandre

@abdellahrk abdellahrk requested a review from smnandre July 23, 2025 07:14
@abdellahrk
Copy link
Author

Thank you @OskarStark

@OskarStark OskarStark changed the title [HttpFoundation] Add Problem Details for HTTP APIs [HttpFoundation] Add ProblemDetailJsonResponse for HTTP APIs Jul 24, 2025
@OskarStark OskarStark changed the title [HttpFoundation] Add ProblemDetailJsonResponse for HTTP APIs [HttpFoundation] Add ProblemDetailsJsonResponse for HTTP APIs Jul 24, 2025
abdellahrk and others added 10 commits July 24, 2025 19:47
This feature adds more detail to the HTTP response errors as specified by RFC 7807 and completed by RFC 9457
….php

Co-authored-by: Simon André <smn.andre@gmail.com>
….php

Co-authored-by: Simon André <smn.andre@gmail.com>
…onResponseException.php

Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
….php

Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
@abdellahrk abdellahrk force-pushed the feature/problem_detail_response branch from 8befed4 to a51dabd Compare July 24, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy