-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Any invalid message in a response crashed the entire response
The code serving the API may return messages that are not valid according the latest version of the schemas. Ignore them with an optional log instead of failing the parsing of the entire response.
- Loading branch information
Showing
2 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from typing import List | ||
|
||
from aleph_message.models import AlephMessage | ||
from pydantic import BaseModel | ||
|
||
|
||
class MessagesResponse(BaseModel): | ||
"""Response from an Aleph node API on the path /api/v0/messages.json""" | ||
|
||
messages: List[AlephMessage] | ||
pagination_page: int | ||
pagination_total: int | ||
pagination_per_page: int | ||
pagination_item: str |