Skip to content

Commit

Permalink
Debugging links->next issues (#1794)
Browse files Browse the repository at this point in the history
* Add additional validator check for next link validity

* Force docker example to use a page limit less than the test data size
  • Loading branch information
ml-evs committed Sep 29, 2023
1 parent 7269566 commit 7bd6b5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .docker/docker_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"debug": true,
"page_limit": 5,
"default_db": "test_server",
"base_url": "http://gh_actions_host:3213",
"implementation": {
Expand Down
4 changes: 4 additions & 0 deletions optimade/validator/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,10 @@ def _test_page_limit(
next_link = response_json["links"]["next"]
if isinstance(next_link, dict):
next_link = next_link["href"]
if not next_link:
raise ResponseError(
"Endpoint suggested more data was available but provided no valid links->next link."
)
except KeyError:
raise ResponseError(
"Endpoint suggested more data was available but provided no valid links->next link."
Expand Down

0 comments on commit 7bd6b5f

Please sign in to comment.