I did some improvements, what you guys think? https://github.com/ivanjunckes/convertertest/pull/2
On Fri, Mar 15, 2019 at 12:46 PM Romain Manni-Bucau <rmannibu...@gmail.com> wrote: > Not so a detail cause you go from a new api quick verbose to impl to be > integrable in johnzon - trivial in an app I agree - to something very > trivial and strongly typed. That said, maybe we lack some doc on that point > - thinking out loud. > > Le ven. 15 mars 2019 à 16:38, Jean-Louis Monteiro < > jlmonte...@tomitribe.com> > a écrit : > > > Oh yes, that's a detail. Ivan can handle it quickly > > -- > > Jean-Louis Monteiro > > http://twitter.com/jlouismonteiro > > http://www.tomitribe.com > > > > > > On Fri, Mar 15, 2019 at 4:37 PM Romain Manni-Bucau < > rmannibu...@gmail.com> > > wrote: > > > > > Noop, the other provider ;), no need to fork it > > > > > > Le ven. 15 mars 2019 à 16:16, Jean-Louis Monteiro < > > > jlmonte...@tomitribe.com> > > > a écrit : > > > > > > > That's the approach I created in Ivan's project > > > > -- > > > > Jean-Louis Monteiro > > > > http://twitter.com/jlouismonteiro > > > > http://www.tomitribe.com > > > > > > > > > > > > On Fri, Mar 15, 2019 at 3:27 PM Romain Manni-Bucau < > > > rmannibu...@gmail.com> > > > > wrote: > > > > > > > > > You can extend existing provider, it was done for that and to avoid > > to > > > > impl > > > > > a token literal just for config (needed for generics) - this is out > > of > > > > > scope of johnzon but can be in xbean. > > > > > > > > > > Le ven. 15 mars 2019 à 15:01, Jean-Louis Monteiro < > > > > > jlmonte...@tomitribe.com> > > > > > a écrit : > > > > > > > > > > > Hey Romain, > > > > > > > > > > > > I was looking at Ivan's example and I think I understand what is > > the > > > > > issue. > > > > > > Basically he's using the configurable provider but we don't have > > any > > > > > > wrapper method around the Mapper to add a new adapter. > > > > > > > > > > > > I created a quick and dirty PR on his project to show him how he > > can > > > > do, > > > > > > but we can probably make it easier if we add the wrappers > ourselves > > > in > > > > > the > > > > > > configuration provider. > > > > > > > > > > > > Obviously the reflection is very quick and dirty so we would need > > to > > > > > change > > > > > > it. > > > > > > > > > > > > https://github.com/ivanjunckes/convertertest/pull/1 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Jean-Louis Monteiro > > > > > > http://twitter.com/jlouismonteiro > > > > > > http://www.tomitribe.com > > > > > > > > > > > > > > > > > > On Fri, Mar 15, 2019 at 1:23 PM Ivan Junckes Filho < > > > > > ivanjunc...@gmail.com> > > > > > > wrote: > > > > > > > > > > > > > Is it possible that you point an example Romain? > > > > > > > > > > > > > > On Thu, Mar 14, 2019 at 6:52 PM Romain Manni-Bucau < > > > > > > rmannibu...@gmail.com> > > > > > > > wrote: > > > > > > > > > > > > > > > Just call builder.addAdapter passing your custom date > formatter > > > and > > > > > it > > > > > > > will > > > > > > > > do what you asks. It replaces the default converter globally. > > No > > > > need > > > > > > of > > > > > > > > any model change. > > > > > > > > > > > > > > > > Le jeu. 14 mars 2019 à 21:04, Ivan Junckes Filho < > > > > > > ivanjunc...@gmail.com> > > > > > > > a > > > > > > > > écrit : > > > > > > > > > > > > > > > > > Dani it could be.. but a simple way to change the date > format > > > > would > > > > > > be > > > > > > > > > better. > > > > > > > > > > > > > > > > > > Romain, can you elaborate? I am not sure I understand. > > > > > > > > > > > > > > > > > > On Thu, Mar 14, 2019 at 1:24 PM Romain Manni-Bucau < > > > > > > > > rmannibu...@gmail.com> > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > Hmm, normally set on the builder and not the annotation > it > > > > works > > > > > as > > > > > > > you > > > > > > > > > > describes. > > > > > > > > > > > > > > > > > > > > Le jeu. 14 mars 2019 à 16:00, Ivan Junckes Filho < > > > > > > > > ivanjunc...@gmail.com> > > > > > > > > > a > > > > > > > > > > écrit : > > > > > > > > > > > > > > > > > > > > > I tried based on the blog but didn't work. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > https://rmannibucau.wordpress.com/2015/07/09/javaee-apache-johnzon-json-library-javascript-date/ > > > > > > > > > > > > > > > > > > > > > > See sample below: > > > > > > > > > > > https://github.com/ivanjunckes/convertertest > > > > > > > > > > > > > > > > > > > > > > But this doesn't also provide the same format for all > > > "Date" > > > > > > > fields, > > > > > > > > I > > > > > > > > > > need > > > > > > > > > > > to go field by field and add the converter. > > > > > > > > > > > > > > > > > > > > > > On Thu, Mar 14, 2019 at 11:41 AM Romain Manni-Bucau < > > > > > > > > > > rmannibu...@gmail.com > > > > > > > > > > > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > Hi Ivan, > > > > > > > > > > > > > > > > > > > > > > > > We support it for jsonb and you can overriee default > > > > > > > > > > adapters/converters > > > > > > > > > > > in > > > > > > > > > > > > johnzon mapper already. > > > > > > > > > > > > > > > > > > > > > > > > Did you try that? Sounds to me we are already covered > > for > > > > > both > > > > > > > > > mappers. > > > > > > > > > > > Am > > > > > > > > > > > > I missing something? > > > > > > > > > > > > > > > > > > > > > > > > Romain > > > > > > > > > > > > > > > > > > > > > > > > Le jeu. 14 mars 2019 à 14:36, Ivan Junckes Filho < > > > > > > > > > > ivanjunc...@gmail.com> > > > > > > > > > > > a > > > > > > > > > > > > écrit : > > > > > > > > > > > > > > > > > > > > > > > > > Hey guys, > > > > > > > > > > > > > > > > > > > > > > > > > > I am from Brazil and would be useful to be able to > > > pass a > > > > > > > > property > > > > > > > > > in > > > > > > > > > > > the > > > > > > > > > > > > > date format from Brazil. > > > > > > > > > > > > > > > > > > > > > > > > > > Is it ok if I submit a PR changing the line below > to > > > > check > > > > > it > > > > > > > > > > > > > "johnzon.default-date-format" has a value then use > > it, > > > if > > > > > not > > > > > > > use > > > > > > > > > the > > > > > > > > > > > > > default yyyyMMddHHmmssZ. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > https://github.com/apache/johnzon/blob/f28196b39ae3d0ff2ccdd8b1e9efe2a5801e1e7f/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/MapperBuilder.java#L81 > > > > > > > > > > > > > > > > > > > > > > > > > > What do you think? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >