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
springboot pageable.one-indexed-parameters=true response pageNumber -1 [DATAREST-1454] #1815
Comments
Oliver Drotbohm commented Can please add more information about the request you send, how many items are returned etc. "Pageable page 1" is not a description of a request we can work with |
Say.li commented one-indexed-parameters: true request: page=1 spring java object Pageable page=0
response: http response parameter: number=0 spring java object page number=0
Unhandled response value |
Say.li commented |
Oliver Drotbohm commented That's not any more detailed than the original request. Ideally, I'd love to see a sample project and a test case that fails. Or at least some documented web requests (e.g. via curl) and the resulting output and in how far that differs from what's expected |
Say.li commented @GetMapping
public Page<ExpertEntity> page(String name, String typeId, String createUserId, Date createStartDate, Date createEndDate, Boolean deleted, @SortDefault.SortDefaults({
@SortDefault(sort = "deleted", direction = Sort.Direction.ASC),
@SortDefault(sort = "sort", direction = Sort.Direction.DESC),
@SortDefault(sort = "createDate", direction = Sort.Direction.DESC)
}) Pageable pageable) {
return this.expertService.page(name, typeId, createUserId, createStartDate, createEndDate, deleted, pageable);
}
spring:
data:
web:
pageable:
one-indexed-parameters: true
response {
"content": [
{
"deleted": false,
"updateDate": "2019-11-15 15:41:28",
"createDate": "2019-09-09 16:41:31",
"id": "1d4b8fb5-b3f0-4122-a444-c1eceb5526fa",
"username": "15828395524",
"name": "李飞龙",
"department": "云服务部",
"enabled": true,
"authoritys": [
{
"deleted": false,
"updateDate": "2019-09-10 16:06:33",
"createDate": "2019-09-10 16:06:33",
"id": "a82c7a21-843d-4fc0-9838-fe953a484855",
"name": "管理员管理",
"uriResources": [
{
"name": "管理员管理",
"uri": "/managerUser/**",
"method": null
}
]
}
]
},
{
"deleted": false,
"updateDate": "2019-09-11 13:46:31",
"createDate": "2019-09-11 13:46:31",
"id": "37360cbd-86c5-4a44-9440-8a0203dd1c64",
"username": "15202805172",
"name": "杨鹏",
"department": null,
"enabled": true,
"authoritys": [
{
"deleted": false,
"updateDate": "2019-09-09 16:15:46",
"createDate": "2019-09-09 16:15:46",
"id": "60d37d03-02cb-4f71-a9ae-4cb7f460a90d",
"name": "社区管理",
"uriResources": [
{
"name": "社区管理",
"uri": "/post/**",
"method": null
}
]
},
{
"deleted": false,
"updateDate": "2019-09-09 16:15:46",
"createDate": "2019-09-09 16:15:46",
"id": "7951c0f5-372c-40f1-978c-fb7e1f360870",
"name": "开发者管理",
"uriResources": [
{
"name": "开发者管理",
"uri": "/developer/**",
"method": null
}
]
},
{
"deleted": false,
"updateDate": "2019-09-09 16:15:46",
"createDate": "2019-09-09 16:15:46",
"id": "a2af4588-db41-4782-8f0e-b4a6f3ff5f3e",
"name": "内容管理",
"uriResources": [
{
"name": "内容管理",
"uri": "/content/**",
"method": null
}
]
},
{
"deleted": false,
"updateDate": "2019-09-10 16:06:33",
"createDate": "2019-09-10 16:06:33",
"id": "a82c7a21-843d-4fc0-9838-fe953a484855",
"name": "管理员管理",
"uriResources": [
{
"name": "管理员管理",
"uri": "/managerUser/**",
"method": null
}
]
},
{
"deleted": false,
"updateDate": "2019-09-09 16:15:46",
"createDate": "2019-09-09 16:15:46",
"id": "bffa63c8-705b-4ee9-8e8b-a32aec56b44a",
"name": "应用管理",
"uriResources": [
{
"name": "应用管理",
"uri": "/application/**",
"method": null
}
]
}
]
},
{
"deleted": false,
"updateDate": "2019-11-01 09:56:59",
"createDate": "2019-11-01 09:56:59",
"id": "ebd88126-c7c3-4414-b267-efcd145dc0ad",
"username": "15681155356",
"name": "何娟",
"department": null,
"enabled": true,
"authoritys": [
{
"deleted": false,
"updateDate": "2019-09-09 16:15:46",
"createDate": "2019-09-09 16:15:46",
"id": "60d37d03-02cb-4f71-a9ae-4cb7f460a90d",
"name": "社区管理",
"uriResources": [
{
"name": "社区管理",
"uri": "/post/**",
"method": null
}
]
},
{
"deleted": false,
"updateDate": "2019-09-09 16:15:46",
"createDate": "2019-09-09 16:15:46",
"id": "7951c0f5-372c-40f1-978c-fb7e1f360870",
"name": "开发者管理",
"uriResources": [
{
"name": "开发者管理",
"uri": "/developer/**",
"method": null
}
]
},
{
"deleted": false,
"updateDate": "2019-09-09 16:15:46",
"createDate": "2019-09-09 16:15:46",
"id": "a2af4588-db41-4782-8f0e-b4a6f3ff5f3e",
"name": "内容管理",
"uriResources": [
{
"name": "内容管理",
"uri": "/content/**",
"method": null
}
]
},
{
"deleted": false,
"updateDate": "2019-09-10 16:06:33",
"createDate": "2019-09-10 16:06:33",
"id": "a82c7a21-843d-4fc0-9838-fe953a484855",
"name": "管理员管理",
"uriResources": [
{
"name": "管理员管理",
"uri": "/managerUser/**",
"method": null
}
]
},
{
"deleted": false,
"updateDate": "2019-09-09 16:15:46",
"createDate": "2019-09-09 16:15:46",
"id": "bffa63c8-705b-4ee9-8e8b-a32aec56b44a",
"name": "应用管理",
"uriResources": [
{
"name": "应用管理",
"uri": "/application/**",
"method": null
}
]
}
]
}
],
"pageable": {
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"offset": 0,
"pageNumber": 0,
"pageSize": 10,
"paged": true,
"unpaged": false
},
"totalElements": 3,
"totalPages": 1,
"last": true,
"size": 10,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"number": 0,
"numberOfElements": 3,
"first": true,
"empty": false
}
debugger Pageable page equals 0, http param page equals 1 response pageNumber and number equals 0, Unaffected one-indexed-parameters
|
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
I had the same issue, but found that it's based on misunderstanding what the |
Say.li opened DATAREST-1454 and commented
application.yml
spring:
data:
web:
pageable:
one-indexed-parameters: true
requset:
Pageable page
1
response:
page.getNumber()
page.getPageable().getPageNumber()
0
Expect: 1
Affects: 3.2.1 (Moore SR1)
1 votes, 2 watchers
The text was updated successfully, but these errors were encountered: