On Tue, Nov 14, 2017 at 6:22 PM, Kean Erickson <
kean.e...@gmail.com> wrote:
> Hey there Tatu,
>
>
> So after adding a provider class extending JacksonJaxbJsonProvider, I've had
> success in producing JSONObjects over GET requests, but there's still some
> trouble still with interpreting POSTed json in requests as JSONObject. I was
> curious, should writing a custom MessageBodyReader still be necessary with
> JsonOrgModule in use?
It should work just fine for GETs, POSTs and PUTs. Should not require
custom MessageBodyReader.
It has been a while since I had to last manually set things up so
unfortunately I don't know.
But I think any datatype module should have similar issues so when
searching for solutions
(StackOverflow is often a good resource), may want to see if there are
questions about
more popular modules like Joda, Guava or Java8 date/time modules.
Or more generally questions about injecting/initializing ObjectMapper to use.
One trick is to get access to `ObjectMapper` framework uses and
register module on that:
this actually works as mapper is mutable before being used.
So it may be possible to inject `ObjectMapper` on some entity you
control, modify that,
instead of trying to do the reverse.
-+ Tatu +-
>
>
> Cheers,
> -Kean
>
> On Mon, Nov 13, 2017 at 1:33 PM, Tatu Saloranta <
ta...@fasterxml.com> wrote:
>>
>> Ok. If so it might make sense to first make sure that framework is
>> using properly configured mapper.
>> One way would be to create a simple stand-alone test with POJO,
>> outside of framework (JAX-RS?).
>> If I understood situation correctly it should just work. One thing I
>> don't know is why value would be serialized
>> as empty String -- I don't see how Jackson would ever produce that.
>>
>> Anyway: if stand-alone case fails as explained I'd like an issue filed
>> for the module since this use case
>> (reading JSON into org.json model; writing JSON out of org.json model)
>> is what module was written for.
>> So it should really "just work".
>>
>> -+ Tatu +-
>>