Skip to content

Add Error:setDescription #7329

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

Merged
merged 1 commit into from
Aug 6, 2025
Merged

Conversation

VincentLanglet
Copy link
Contributor

@VincentLanglet VincentLanglet commented Jul 31, 2025

Q A
Branch? main
Tickets Closes
License MIT
Doc PR api-platform/docs#...

Currently, when setting the details, it set both the description and the details since the getDescription returns

public function getDescription(): ?string
    {
        return $this->detail;
    }

So I feel like we're missing a setDescription, this way:

  • To override both description and detail, we use setDetails
  • To just override the description, we use setDescription

And both field now might have a different value.

@soyuka
Copy link
Member

soyuka commented Aug 1, 2025

It's because description is a hydra error specific field and that detail and description are basically representing the same information. Not sure there's an interest in differing both information, although I see no reason we shouldn't give the ability to do so.

Should target main.

@VincentLanglet VincentLanglet changed the base branch from 4.1 to main August 1, 2025 07:50
@VincentLanglet
Copy link
Contributor Author

VincentLanglet commented Aug 5, 2025

Should target main.

Done, failure seems unrelated

@soyuka soyuka merged commit f25d7d1 into api-platform:main Aug 6, 2025
112 of 114 checks passed
@soyuka
Copy link
Member

soyuka commented Aug 6, 2025

thanks!

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

Successfully merging this pull request may close these issues.

2 participants