Skip to content

Add BasicPolymorphicTypeValidator.Builder.allowIfSubTypeIsArray() #2534

@cowtowncoder

Description

@cowtowncoder

(follow up to #2532)

Since Java array types are real non-generic types, distinct from type of elements contained, there is a use case where one might want to accept all Array-valued subtypes, regardless of elements contained. This does not actually allow all possible element values within since polymorphic type handling should be applied separately to values themselves (and as far as I can tell, is the case for all standard DefaultTyping cases, and annotation-based approach as well).

To support this, let's add allowIfSubTypeIsArray() in Builder of BasicPolymorphicTypeValidator: it will still need to be explicitly enabled (to avoid any possibility of otherwise leaking gadget types in case developer has managed to implement custom inclusion criteria), but is simple addition for cases where Array values are stored as polymorphic values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions