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

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

Open
nipanwar77 opened this issue Jan 6, 2025 · 1 comment

Comments

@nipanwar77
Copy link

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

@nipanwar77
Copy link
Author

Any update on this?

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

No branches or pull requests

1 participant