GithubHelp home page GithubHelp logo

Comments (3)

4braincells avatar 4braincells commented on August 12, 2024

Bildschirmfoto 2022-07-06 um 09 12 37
Bildschirmfoto 2022-07-06 um 09 11 58
Bildschirmfoto 2022-07-06 um 09 12 08

Now still struggling with the question how Feature , when called for serialisation in Jackson,
comes to the decision to check a DATE feature as BIGDECIMAL, BINARY or INT (seems to be a RANDOM decision)

from license3j.

4braincells avatar 4braincells commented on August 12, 2024

OK, found. "Feature" is not serializable *) by Jackson. Which makes it a bit nasty to dump the license/features to a JSON string.

*) because throwing exeptions in getters (which aren't getters anyway) is a very "creative" approach ...

from license3j.

verhas avatar verhas commented on August 12, 2024

Jackson serialization tries to use the fields as well as the getters of the object. Jackson thinks the methods starting get are getters in these cases. They are kind of getters, but not strict Java beans getters. The solution is to tell Jackson not to try to be brighter than it is and to configure the mapper not to use the getters, only the fields.

On this

https://stackoverflow.com/questions/7105745/how-to-specify-jackson-to-only-use-fields-preferably-globally

StackOverflow page, you can get a detailed description of how you can do that. I have not verified that, but this would be the way where I would start to go.

because throwing exceptions in getters (which aren't getters anyway) is a very "creative" approach ...

I understand your frustration, and I am sorry about that. It seemed to be a good idea. But fortunately, many users use this little library, and thus it is not feasible to change it.

from license3j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.