Skip to content

ReflectiveHierarchyStep, JSON and index issue #385

@gsmet

Description

@gsmet

Rostislav raises an interesting issue here:
https://github.com/jbossas/protean-shamrock/pull/382/files#diff-055eeb55f92133d7a1d8e079e56faf93R19

trying to solve this warning:

[WARNING] [org.jboss.shamrock.deployment.steps.ReflectiveHierarchyStep] Unable to find annotation info for javax.json.JsonObject, it may not be correctly registered for reflection

We register the return types of JAX-RS methods for reflection and this might happen even if they are not properly present in the Jandex index and in this case ReflectiveHierarchyStep marks the given class for reflection but does not go the extra mile as to mark the super classes for reflection.

If we consider that JsonObject and friends of the various implementations are likely candidates for that, we should probably not ask for the user to push them to the Jandex index. AFAICS, it already works but we should probably find way to avoid the warning in this case.

By the way, if it's limited to JSON and Jackson serialization, I'm wondering why we also register the parameter types as I would expect the serializer to only work on the getters and fields (so I can see why we mark the return types for reflection but not the parameter types)? Did we have a specific case in mind?

I'm also wondering if we should register the subclasses for reflection as if you have Vehicle getVehicle(), you could also return a Car and it should be serializable by the JSON implementations.

@stuartwdouglas I see you implemented that, do you have any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions