Skip to content
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

Make ProblemDetail implement Serializable #34409

Closed
takashno opened this issue Feb 11, 2025 · 0 comments
Closed

Make ProblemDetail implement Serializable #34409

takashno opened this issue Feb 11, 2025 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@takashno
Copy link

Expected Behavior

The ProblemDetail class should be serializable
so that it can be used in distributed environments where serialization is required.

Actual Behavior

Currently, ProblemDetail does not implement Serializable,
which can cause issues when attempting to serialize instances of this class.

Suggested Fix

Modify the class declaration as follows:

Before

public class ProblemDetail {

After

import java.io.Serializable

public class ProblemDetail implements Serializable {

Use Case

In some scenarios, such as caching or distributed systems, ProblemDetail instances need to be serialized.
Making it Serializable would improve compatibility with frameworks that rely on serialization.

Environment

Spring Framework Version: v6.2.1
JDK Version: corretto 21

Additional Information

If there is a specific reason why ProblemDetail was not made Serializable,
it would be helpful to clarify whether this is intentional or an oversight.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 11, 2025
@bclozel bclozel added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Feb 11, 2025
@bclozel bclozel added this to the 6.2.3 milestone Feb 11, 2025
@bclozel bclozel self-assigned this Feb 11, 2025
@bclozel bclozel changed the title ProblemDetail should implement Serializable Make ProblemDetail implement Serializable Feb 11, 2025
bclozel added a commit that referenced this issue Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants