algolia / algolia/algoliasearch-client-dart

searchSingleIndex doesn't support offset,length pagination query

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
17
Forks
10
PR merge metrics
No merged PRs in 30d

Description

When passing offset,length parameter into searchSingleIndex ,the response have different data then what decoder expect causing error.
```
I/flutter (11302): CheckedFromJsonException
I/flutter (11302): Could not create `SearchResponse`.
I/flutter (11302): There is a problem with "hitsPerPage".
I/flutter (11302): type 'Null' is not a subtype of type 'int' in type cast
I/flutter (11302): #0 $checkedConvert (package:json_annotation/src/checked_helpers.dart:91:5)
I/flutter (11302): #1 $checkedCreate.checkedConvert (package:json_annotation/src/checked_helpers.dart:28:7)
I/flutter (11302): #2 _$SearchResponseFromJson. (package:algolia_client_search/src/model/search_response.g.dart:41:39)
I/flutter (11302): #3 $checkedCreate. (package:json_annotation/src/checked_helpers.dart:33:22)
I/flutter (11302): #4 $checkedNew (package:json_annotation/src/checked_helpers.dart:51:23)
I/flutter (11302): #5 $checkedCreate (package:json_annotation/src/checked_helpers.dart:30:10)
I/flutter (11302): #6 _$SearchResponseFromJson (package:algolia_client_search/src/model/search_response.g.dart:10:5)
I/flutter (11302): #7 new SearchResponse.fromJson (package:algolia_client_search/src/model/search_response.dart:234:7)
I/flutter (11302): #8 deserialize (package:algolia_client_search/src/deserialize.dart:454:29)
I/flutter (11302): #9 SearchClient.searchSingleIndex (package:algolia_client_search/src/api/search_client.dart:1987:12)
I/flutter (11302):
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in lib/api/search_client.dart at SearchClient.searchSingleIndex, then inspect lib/model/search_response.dart, its generated search_response.g.dart decoder, and lib/deserialize.dart. Reproduce a searchSingleIndex request with offset and length, compare the returned data with the decoder's expectations, and confirm that the response is decoded without the reported hitsPerPage error.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.