Skip to content

Deserialization Error after Upgrading Jackson Version from 2.17.2 to 2.18.2 #278

@nipanwar77

Description

@nipanwar77

After upgrading the Jackson version from 2.17.2 to 2.18.2, I'm encountering a deserialization error while running the openapi3 task in my build. The error occurs when Jackson attempts to deserialize a Schema object within a ResourceModel object.

The error message is as follows:

> Task :openapi3 FAILEDFAILURE: Build failed with an exception.* 
What went wrong:
Execution failed for task ':openapi3'.> 
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.epages.restdocs.apispec.model.Schema` (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)   
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 83, column: 7] (through reference chain: com.epages.restdocs.apispec.model.ResourceModel["response"]->com.epages.restdocs.apispec.model.ResponseModel["schema"]) 

It seems that Jackson is unable to deserialize the Schema class due to the lack of an appropriate creator, such as a @JsonCreator annotation or a no-argument constructor. This is causing the deserialization to fail.

Expected behavior:
The Schema class should be properly deserialized by Jackson, either using a no-argument constructor or a @JsonCreator annotation.
Suggested fix:
Ensure that the Schema class has a no-argument constructor or a @JsonCreator annotated constructor to allow proper deserialization.
Verify that the ePages library is compatible with Jackson 2.18.2 to prevent future compatibility issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions