Not sure which part so trying to answer a bit blindly:

1 add your converter as in the blog post
2 pass the mapper to the jaxrs provider constructor
https://github.com/apache/johnzon/blob/master/johnzon-jaxrs/src/main/java/org/apache/johnzon/jaxrs/JohnzonProvider.java
3 register the mapper either extending it or using some ioc config - if in
tomee both would work normally thanks to xbean and resources.xml but it is
a topic for tomee list ;)

Le ven. 15 mars 2019 à 13:23, Ivan Junckes Filho <ivanjunc...@gmail.com> a
écrit :

> 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?
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Reply via email to