Skip to content

Enhance ResourceAssemblerSupport to allow generics #572

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

Closed
gregturn opened this issue Mar 31, 2017 · 1 comment
Closed

Enhance ResourceAssemblerSupport to allow generics #572

gregturn opened this issue Mar 31, 2017 · 1 comment
Assignees
Milestone

Comments

@gregturn
Copy link
Contributor

Currently, ResourceAssemblerSupport requires making the domain object either subclass ResourceSupport (like EmployeeResource extends ResourceSupport) or creating a separate class (like class EmployeeResource extends Resource<Employee>).

If we could extract the core code that presumes a class signature of ResourceAssemblerSupport<Employee>, presuming the target resource type is Resource<Employee>, that would make many things simpler.

@gregturn gregturn self-assigned this Mar 31, 2017
gregturn added a commit that referenced this issue May 23, 2017
Implement a ResourceAssembler that returns a Resource<T> solely based on a non-Resource domain class.
gregturn added a commit that referenced this issue May 23, 2017
Implement a ResourceAssembler that returns a Resource<T> solely based on a non-Resource domain class.

Related issues: #416
gregturn added a commit that referenced this issue Sep 26, 2017
To avoid confusion about what to return on a Spring MVC endpoint, change toResources to not return `List<D>`, but instead `Resources<D>`. This clearly ensures when used to construct Spring MVC endpoints, will return a type Spring HATEOAS will properly marshal.

Related issues: #493
Related pull requests: #572
gregturn added a commit that referenced this issue Sep 26, 2017
To avoid confusion about what to return on a Spring MVC endpoint, change toResources to not return `List<D>`, but instead `Resources<D>`. This clearly ensures when used to construct Spring MVC endpoints, will return a type Spring HATEOAS will properly marshal.

Related issues: #493
Related pull requests: #572
gregturn added a commit that referenced this issue Sep 10, 2018
Implement a ResourceAssembler that returns a Resource<T> solely based on a non-Resource domain class.

Related issues: #416
gregturn added a commit that referenced this issue Sep 10, 2018
Implement a ResourceAssembler that returns a Resource<T> solely based on a non-Resource domain class.

Related issues: #416
gregturn added a commit that referenced this issue Dec 6, 2018
To avoid confusion about what to return on a Spring MVC endpoint, change toResources to not return `List<D>`, but instead `Resources<D>`. This clearly ensures when used to construct Spring MVC endpoints, will return a type Spring HATEOAS will properly marshal.

Related issues: #493
Related pull requests: #572
gregturn added a commit that referenced this issue Dec 6, 2018
To avoid confusion about what to return on a Spring MVC endpoint, change toResources to not return `List<D>`, but instead `Resources<D>`. This clearly ensures when used to construct Spring MVC endpoints, will return a type Spring HATEOAS will properly marshal.

Related issues: #493
Related pull requests: #572
gregturn added a commit that referenced this issue Dec 6, 2018
To avoid confusion about what to return on a Spring MVC endpoint, change toResources to not return `List<D>`, but instead `Resources<D>`. This clearly ensures when used to construct Spring MVC endpoints, will return a type Spring HATEOAS will properly marshal.

To support people that have already built apps on top of Lists, include a `toList<D>` method that honors the old contract.

Related issues: #493
Related pull requests: #572

Hack
gregturn added a commit that referenced this issue Dec 18, 2018
To avoid confusion about what to return on a Spring MVC endpoint, change toResources to not return `List<D>`, but instead `Resources<D>`. This clearly ensures when used to construct Spring MVC endpoints, will return a type Spring HATEOAS will properly marshal.

To support people that have already built apps on top of Lists, include a `toList<D>` method that honors the old contract.

Related issues: #493
Related pull requests: #572
gregturn added a commit that referenced this issue Dec 18, 2018
Implement a ResourceAssembler that returns a Resource<T> solely based on a non-Resource domain class.

Related issues: #416
gregturn added a commit that referenced this issue Dec 18, 2018
Implement a ResourceAssembler that returns a Resource<T> solely based on a non-Resource domain class.

Related issues: #416
gregturn added a commit that referenced this issue Dec 18, 2018
Implement a ResourceAssembler based solely on a domain type, returning Resource<T> for the `toResource(obj)` method.

Related issues: #416
gregturn added a commit that referenced this issue Dec 18, 2018
Implement a ResourceAssembler based solely on a domain type, returning Resource<T> for the `toResource(obj)` method.

Related issues: #416
gregturn added a commit that referenced this issue Dec 18, 2018
Implement a ResourceAssembler based solely on a domain type, returning Resource<T> for the `toResource(obj)` method.

Related issues: #416
gregturn added a commit that referenced this issue Dec 18, 2018
Implement a ResourceAssembler based solely on a domain type, returning Resource<T> for the `toResource(obj)` method.

Related issues: #416
schauder added a commit that referenced this issue Dec 19, 2018
Removed redundant asserts.
schauder added a commit that referenced this issue Dec 19, 2018
Fixed test with missing assertions.

IdentifiableResourceAssemblerSupportUnitTest.unwrapsIdentifyablesForParameters now fails and I'm not sure how it really should look like.

Also: My formatter just removed the blank line in the imports that yours probably introduced.
Which one is the right one?
gregturn added a commit that referenced this issue Dec 19, 2018
Implement a ResourceAssembler based solely on a domain type, returning Resource<T> for the `toResource(obj)` method.

Related issues: #416
gregturn pushed a commit that referenced this issue Dec 19, 2018
Removed redundant asserts.
@gregturn
Copy link
Contributor Author

Resolved via a56392a.

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

No branches or pull requests

1 participant