Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Patouche opened this issue May 29, 2020 · 3 comments · May be fixed by #1303
Open

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

Patouche opened this issue May 29, 2020 · 3 comments · May be fixed by #1303

Comments

@Patouche
Copy link
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.

@Patouche Patouche 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 May 29, 2020
@gregturn
Copy link
Contributor

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

Patouche added a commit to Patouche/spring-hateoas that referenced this issue Jun 2, 2020
@Patouche
Copy link
Contributor Author

Patouche commented Jun 2, 2020

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.

Patouche added a commit to Patouche/spring-hateoas that referenced this issue Jun 3, 2020
Patouche added a commit to Patouche/spring-hateoas that referenced this issue Jun 3, 2020
Patouche added a commit to Patouche/spring-hateoas that referenced this issue Jun 3, 2020
Patouche added a commit to Patouche/spring-hateoas that referenced this issue Jun 3, 2020
Patouche added a commit to Patouche/spring-hateoas that referenced this issue Jun 3, 2020
@Patouche Patouche linked a pull request Jun 3, 2020 that will close this issue
@stephaneeybert
Copy link

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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants