Skip to content

Out of the box Pageable JSON deserializer [DATACMNS-758] #1219

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
spring-projects-issues opened this issue Aug 24, 2015 · 6 comments
Closed
Assignees
Labels
has: design-decision An issue that contains a design decision about its topic status: declined A suggestion or change that we don't feel we should currently apply

Comments

@spring-projects-issues
Copy link

Filip Hrisafov opened DATACMNS-758 and commented

While trying out some projects with spring data I realized that there is not out of the box deserializer from JSON to Pageable.

I saw that there is the PageableHandlerMethodArgumentResolver which is used to resolve Pageable objects from the query string. I think that it might be a good a thing if there is somtething similar that can be used to automatically create Pageable objects from JSON.

A use case for this would be to use Pageable objects in objects that are being send with JSON.

I am sorry if this is the wrong place for this issue. Please let me know where I should submit it if this is not the place


No further details from DATACMNS-758

@spring-projects-issues
Copy link
Author

Jens Schauder commented

Having a Pageable as part of another object sounds not like a very common scenario to me.

Therefore I'm marking this issue as "not likely" and will close it if no new arguments in favor of it a brought forward

@spring-projects-issues
Copy link
Author

Filip Hrisafov commented

Why do you think it is not a common scenario?

We have objects with complex search criterias, apart from the different custom criteria that we have, we want to sent Pageable information to the server and directly give it to the Repository. Having this allows out of the box support for paging and sorting

@spring-projects-issues
Copy link
Author

Oliver Drotbohm commented

That's in place with PageableHandlerMethodArgumentResolver constructing a PageRequest from request parameters, isn't it?

@spring-projects-issues
Copy link
Author

Filip Hrisafov commented

Yes it is. However, that works only if you send the Pageable via query parameters and not via POST for example.

Is the suggestion to use query parameters for the Pageable with POST requests?

@spring-projects-issues
Copy link
Author

Oliver Drotbohm commented

I'd love to learn about an example where sending that information via the request body makes sense. PageRequest is usually used to limit the response for collection resources, for which request parameters make perfect sense. You're still free to implement a custom Jackson deserializer, I just currently don't see this as a scenario common enough to promote it to ship out of the box

@spring-projects-issues
Copy link
Author

Filip Hrisafov commented

I figured that it is not a common scenario to be considered shipping it out of the box. A custom Jackson deserializer does the work.You can close the issue if you want to

@spring-projects-issues spring-projects-issues added status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement labels Dec 30, 2020
@mp911de mp911de added has: design-decision An issue that contains a design decision about its topic and removed type: enhancement A general enhancement labels Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has: design-decision An issue that contains a design decision about its topic status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

3 participants