Skip to content

Payload v2 singletweet#83

Merged
Yomguithereal merged 5 commits intomasterfrom
payload-v2-singletweet
Feb 24, 2026
Merged

Payload v2 singletweet#83
Yomguithereal merged 5 commits intomasterfrom
payload-v2-singletweet

Conversation

@pournaki
Copy link
Contributor

When the Twitter v2 payload contains a single tweet, the data entry is a single dict instead of a list.

This branch handles such cases by modifying two functions:

  • twitwi/utils.py/validate_payload_v2(): extend the possible types of payload['data'] from dict to (list,dict).
  • twitwi/normalizers.py/normalize_tweets_payload_v2(): create a list with the tweet as a single entry such to keep the logic of the function the same.

An example is in test/resources/payload-v2-singletweet.json and the resource was added to test/normalizers_test.py, but I am not sure how to proceed such that the test runs through.

@Yomguithereal Yomguithereal merged commit fcf9122 into master Feb 24, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants