Skip to content

Spring does not log deserialization / marshalling errors to the console [SPR-13100] #17691

@spring-projects-issues

Description

@spring-projects-issues

Ole K Ersoy opened SPR-13100 and commented

When submitting dates that Spring does not know how to desearialize it's possible to see the exception in the REST response. For example I can do the following:

    response =
        given().auth()
            .basic(ADMIN_USER, PASSWORD)
            .contentType(APPLICATION_JSON_CONTENT_TYPE)
            .body(updatedJSON)
            .when()
            .put(contactRestPath);

    System.out.println(response.getBody().asString());

I was running the above in a test, however GSON did not serialize the date to something Spring could read, thus the corresponding controller method (Update method) was never called. It would be nice if Spring could log the exception to the console, so that what is happening is more clear.

SIDE NOTE:
GSON has been around for a while, so I assumed that it would have a serialization/desearialization strategy that fits well with most rest frameworks:
google/gson#650

Cheers,

  • Ole

Affects: 4.2 RC1

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions