Hi
On 09/09/13 17:11, David Hay wrote:
Hi Sergey,

Digging a little deeper, I suspect that I have to do some kind of custom
code here...  When the JSON is read, the right type of Enum B needs to
be selected, which is further complicated by the fact that enums that
implement B can share the same text string too.

Is it best to provide my only MessageBodyReader, or is there some kind
of type mapper I can add?


I guess providing a custom MBR is the way to go, may be you extend JSONProvider to simplify it a bit

Cheers, Sergey




On Mon, Sep 9, 2013 at 11:44 AM, Sergey Beryozkin <[email protected]
<mailto:[email protected]>> wrote:

    Hi

    On 09/09/13 16:35, David Hay wrote:

        Hi,

        I have a class with 2 enum properties - a concrete one (A), and
        one that
        implements an interface (B) and has multiple implementations,
        which are
        possible values for the selected value of A.  If A has the value
        1, the B
        will be of type Enum1, which has the possible values for type 1.

        When I POST to a REST endpoint to create this object, CXF has
        problems
        because of the Interface.

        What's the best way to add something that will allow JSON posted
        to be
        mapped to the right enum type for the 2nd Enum?

    Can you please try CXF 2.7.7-SNAPSHOT (or CXF 2.6.10-SNAPSHOT) and
    see if it handles it better ?
    Or show here how the code looks like

    Cheers, Sergey


Reply via email to