Skip to content

Change default for SerializationFeature.FAIL_ON_EMPTY_BEANS to false #3070

@gregorriegler

Description

@gregorriegler

I would expect an empty Object without any field to be rendered as {}

When I drove a Spring Boot Rest API with an Acceptance Test step by step, I tried to respond with an empty Object at one point, expecting an empty Json Object as a response.
However, Spring noticed that Jackson would not serialize this Object, and instead jumped to the next Converter which caused unrelated Issues. It took me about 1 hour of analyzing at the wrong end, to figure out the real cause.

I think it would be beneficial for developers, if the default of FAIL_ON_EMPTY_BEANS was false, and an empty Json Object would be created in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.0Issue planned for initial 3.0 release3.0-release-notesIssues relevant for 3.0 release notes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions