Skip to content

Fluent Api for adding links to a PagedModel return a CollectionModel #1300

@Patouche

Description

@Patouche
Contributor

Hi the spring team,

When we use the add method on a PagedModel, this method will return a CollectionModel and we "loose" the type PagedModel type. In fact, if we want to retrieve it, we can cast the CollectionModel into a PagedModel.

This can be achieve creating a new abstract class AbstractCollectionModel<S extends AbstractCollectionModel<S, T>, T> which will extends RepresentationModel<S>. After that, CollectionModel<T> will be empty and will extends AbstractCollectionModel<CollectionModel<T>, T> and it will be almost the same for PagedModel

I can submit a PR if you want with this changes.

Activity

changed the title [-]Fluent Api for adding links to a PagedModel returnt a CollectionModel[/-] [+]Fluent Api for adding links to a PagedModel return a CollectionModel[/+] on May 29, 2020
gregturn

gregturn commented on May 29, 2020

@gregturn
Contributor

Actually I'd like to see that, if it isn't too much effort on your end.

added a commit that references this issue on Jun 2, 2020
Patouche

Patouche commented on Jun 2, 2020

@Patouche
ContributorAuthor

Hello,

I've started working on it. It's a little bit harder than I was thinking at first with the Jackson Serializer/Deserialiser.

I will submit this PR when It will be ready.

added 5 commits that reference this issue on Jun 3, 2020
linked a pull request that will close this issue on Jun 3, 2020
stephaneeybert

stephaneeybert commented on Jul 28, 2024

@stephaneeybert

Seeing this old issue still opened I now wonder if the spring-hateoas project is still alive ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @stephaneeybert@gregturn@Patouche

      Issue actions

        Fluent Api for adding links to a PagedModel return a CollectionModel · Issue #1300 · spring-projects/spring-hateoas