Skip to content

Improvements to fetch.unionWith API #2640

@homedirectory

Description

@homedirectory

Description

Method fetch.unionWith dates all the way back to 2012 and it is time to improve it.
Although this method is rarely used in end applications, when it is used, it often requires explicit type casts.

  • 1. Change the type signature of unionWith so that the union of two fetch<T> results in the same type fetch<T>.

    This is a breaking change, as it may cause compilation errors.

  • 2. Provide an alternative method for dynamic use cases where one or both fetch models are fetch<?>.
    This method should throw if the entity types underlying the fetch models are not compatible (one should be a supertype of the other, or vice versa).

Expected outcome

More convenient and type safe use of fetch.unionWith.

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIAn Application Programming Interface, DSL, utility was introduced or modifiedBreaking changeMajorIndicates a major versioning impact.P3 - normalUnder reviewNo work should start, pending review and refinement of the proposed changes.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions