Closed marcokleijer closed 4 years ago
For now I have a workaround by overriding the serialization configuration of QueryItem
with:
Utils.getSimpleObjectMapper().addMixIn(QueryItem.class, QueryItemMixIn.class);
and:
interface QueryItemMixIn {
@JsonIgnore
abstract Logger getLogger();
}
Problem lies in Jackson trying to serialize the Logger exposed by com.azure.data.cosmos.JsonSerializable#getLogger()
which is inherited by QueryItem
.
@marcokleijer This is a bug on Cosmos SDK side. I have tried to fix it here: https://github.com/Azure/azure-sdk-for-java/pull/5951
If the PR gets in, this should be fixed in 2.2.0
For the time being, I have also included this fix in this PR: https://github.com/microsoft/spring-data-cosmosdb/pull/445
This has been released in spring-data-cosmosdb v2.2.0
When I have a Cosmos DB configured with SQL Api, and use spring-data-cosmosdb to write and read from this database, and I try to paginate and sort with a pageSize less than the total items available in the database, I get the following exception:
which boils down to the following code
Use attached project to reproduce the issue. paging-sorting-issue.zip
PagingSortingIssueApplication
/events
/events?page=0&size=2
/events?sort=date,desc
/events?page=0&size=5&sort=date,desc
/events?page=0&size=2&sort=date,desc