Skip to content

Afterburner SuperSonicBeanDeserializer does not handle JSON Object valued Object Ids (like json) #54

@headw01

Description

@headw01

I am attempting to use something like https://github.com/jsog/jsog-jackson so that a .Net client (through a Jackson-using API endpoint) can process references (with "$id" as the @JsonIdentityInfo property value and "$ref" for the JSON Reference). When Afterburner is used, this doesn't work because the SuperSonicBeanDeserializer.deserializeFromObject doesn't check with the _objectIdReader to see if that should be used.

The databind BeanDeserializer has a check for the _objectIdReader (per databind#622 in comment)

public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) throws IOException
{
    /* 09-Dec-2014, tatu: As per [databind#622], we need to allow Object Id references
     *   to come in as JSON Objects as well; but for now assume they will
     *   be simple, single-property references, which means that we can
     *   recognize them without having to buffer anything.
     *   Once again, if we must, we can do more complex handling with buffering,
     *   but let's only do that if and when that becomes necessary.
     */
    if ((_objectIdReader != null) && _objectIdReader.maySerializeAsObject()) {
        if (p.hasTokenId(JsonTokenId.ID_FIELD_NAME)
                && _objectIdReader.isValidReferencePropertyName(p.getCurrentName(), p)) {
            return deserializeFromObjectId(p, ctxt);
        }

The SuperSonicBeanDeserializer overrides BeanDeserializer.deserializeFromObject and doesn't have a similar check.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions