Skip to content

fix: create clip api method and change response type #498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 16, 2025

Conversation

jacobtread
Copy link
Contributor

Description

Updates the create-clip API to use the POST method instead of GET along with some minor docs updates

Changes

  • Updates the create-clip request to use the POST method
  • Align the documentation with the latest current Twitch documentation

Related Issues

Updates the create-clip request to use the POST method

Also includes docs changes to align the documentation with the latest current twitch documentation
Copy link
Contributor

@Nerixyz Nerixyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do wonder why we return a vector of clips rather than one. That would be a breaking change, though. So we should keep that in mind when we do a 0.x bump.

@jacobtread
Copy link
Contributor Author

I do wonder why we return a vector of clips rather than one. That would be a breaking change, though. So we should keep that in mind when we do a 0.x bump.

The twitch API documentation here specifies that the response is an array

{
   "data":
   [{
      "id": "FiveWordsForClipSlug",
      "edit_url": "http://clips.twitch.tv/FiveWordsForClipSlug/edit"
   }]
}

Not sure if you have any way built into your response handling to transform that?

Co-authored-by: nerix <nero.9@hotmail.de>
@Nerixyz
Copy link
Contributor

Nerixyz commented Aug 9, 2025

The twitch API documentation here specifies that the response is an array

Yea, all responses from Twitch are arrays (not sure why).

Not sure if you have any way built into your response handling to transform that?

We have parse_single_return for this.

@Emilgardis
Copy link
Member

Could we change the response type in the impl Response to just be CreatedClip, this change will need a bump anyway. See for example

helix::parse_single_return(request, uri, response, status)
for how to do it

@jacobtread
Copy link
Contributor Author

I have updated it to use the parse_single_return :)

@jacobtread jacobtread changed the title fix: create clip api method fix: create clip api method and change response type Aug 10, 2025
@jacobtread jacobtread requested a review from Nerixyz August 16, 2025 01:50
Copy link
Contributor

@Nerixyz Nerixyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Emilgardis Emilgardis added this pull request to the merge queue Aug 16, 2025
Merged via the queue into twitch-rs:main with commit 2cb4c3b Aug 16, 2025
19 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.

Incorrect HTTP method for clips endpoint
3 participants