Code Monkey home page Code Monkey logo

Comments (6)

cowtowncoder avatar cowtowncoder commented on September 6, 2024

On adding feature: PRs welcome.

from jackson-modules-java8.

mpkorstanje avatar mpkorstanje commented on September 6, 2024

Cheers! I'll try and rustle up something.

from jackson-modules-java8.

cowtowncoder avatar cowtowncoder commented on September 6, 2024

Hmmh. But what is the need to use "quoted numbers" instead of plain numbers?

from jackson-modules-java8.

mpkorstanje avatar mpkorstanje commented on September 6, 2024

Hmmh. But what is the need to use "quoted numbers" instead of plain numbers?

Unfortunately the data I'm reading is using timestamps formatted as quoted numbers. The systems producing this data are rather old and peculiar. And I would agree that in principle they need not be this way. But this is the reality I'm working with.

Nevertheless, without a formatter (i.e. @JsonFormat annotation) it is possible to read these dates in the current implementation. It is currently possible to de-serialize "3.141592653" into a ZoneDateTime. However when adding the @JsonFormat annotation this is no-longer the case. This is the inconsistency I'm trying to address.

Unfortunately I can not access the issue that prompted the original addition of the "read qouted numbers as timestamps" feature (datatype-jsr310#16) but looking at FasterXML/jackson-datatype-jsr310@f85c708 that resolved it appears to be a similar use-case.

So I am not looking to enable a novel use for quoted numbers, rather I'm looking to make an already supported use-case consistent with other features of the library.

from jackson-modules-java8.

cowtowncoder avatar cowtowncoder commented on September 6, 2024

Ok. That makes sense.

So, I am not against supporting such use cases; my main concern is with API. Unfortunately whereas there is now extensive configurability for "alternative Shapes" (accept String where Number is expected) is not quite what we have here, because Date/Time DOES accept String values (ISO-8610) but rather "String that is actually a Number. Because of that extra configurability is indeed needed.

But I am trying to limit use of DeserializationConfig for very specific/targeted uses: it should be for "bigger" features -- there are some legacy settings that are different, but for new things they should be general-purpose ones.

Given this, I think I would actually suggest adding configurability in JavaTimeModule; especially since this is not meant to affect JDK or Joda date/time types.

If this can be done, I'd be happy to get it merged.

I'll add similar note to jackson-databind issue.

from jackson-modules-java8.

mpkorstanje avatar mpkorstanje commented on September 6, 2024

Cheers. I'll have a look at how to accomplish this. Might take a little while.

from jackson-modules-java8.

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.