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

Enhancement: Support for Direct Serialization and Deserialization of Quantity Objects #543

Open
k1ng-maus opened this issue Jul 8, 2024 · 1 comment
Labels
feature New feature or request

Comments

@k1ng-maus
Copy link

Description:
Currently, the library does not support direct serialization and deserialization of Quantity objects. This limitation prevents the use of Quantity as a standalone object in endpoints, resulting in a NullPointerException. An example of the issue is shown below:

@PostMapping
public Quantity<Length> readQuantity(@RequestBody Quantity<Length> payload) {
    return payload;
}

The following exception is thrown:

java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.databind.BeanProperty.getType()" because "property" is null 

Improvement Proposal:
I propose adding support for the direct serialization and deserialization of Quantity objects. This would allow developers to use Quantity in RESTful APIs and other contexts without wrapping it in a POJO.

Personal Experience:
I have been exploring the library and its capabilities, and I like what I have seen. However, I believe that we can improve it even more.

Implementation Offer:
If it is acceptable, I am willing to implement this feature. Please let me know if this is okay, and I will be happy to start working on it.

Thank you for considering this enhancement.

@raynigon
Copy link
Owner

Good point, the library is not designed to handle this case.
I will take a look on how this can be implemented!

@raynigon raynigon added the feature New feature or request label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants