Skip to content
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

Mock API updates #302

Merged
merged 17 commits into from Dec 22, 2023
Merged

Mock API updates #302

merged 17 commits into from Dec 22, 2023

Conversation

aaricdev
Copy link
Contributor

@aaricdev aaricdev commented Dec 17, 2023

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Problem/Feature

Sorry for the slightly bigger PR!

For my current CI, I've started using the mock API to validate my PHP Twitch API SDK implementation against an actual system. These are some problems I've encountered while comparing the mock API, Twitch API docs and my implementation.

(I've tried to compare most of it by actually throwing some calls against the prod API and also started a Postman collection and environment for this)

Description of Changes:

  1. Changed status code of PUT /chat/color from 200 to 204
  2. Fixed a typo in clip struct
  3. Renamed started_at property in predictions to created_at in json mapping
  4. Wrapped raids response when starting a raid into an array
  5. Wrapped responses from POST / PATCH /schedule/segment into actual API responses
  6. Renamed video_languageproperty of Videostruct to language
  7. Changed that gifterId/Name/Login is not omitted when isGifted == false, but just noticed, that the check user subscription works exactly the opposite way (so this should be reverted)
  8. Changed that DateRange is always sent and the way started_at works to be closer to the prod API
  9. Renamed reward_prompt to just prompt
  10. Changed that user_input will return an empty string instead of null
  11. Add points as possible property for APIResponse, returning the total for simplicities sake on /subscriptions response
  12. Changed naming of video_offset for video_muted_segment
  13. Removed timezone property for schedule segments. I've accidentally removed it from PATCH/POST body, but will put it in back in another commit
  14. Added that when removing a video, the corresponding entry in stream_markers table will be deleted, too

Open TODOs

  • Revert changes from 7.
  • Add timezone from 13. back to PATCH/POST body
  • Fix broken tests

Checklist

  • My code follows the Contribution Guide
  • I have self-reviewed the changes being requested
  • I have made comments on pieces of code that may be difficult to understand for other editors
  • I have updated the documentation (if applicable)

@aaricdev aaricdev marked this pull request as ready for review December 17, 2023 21:46
@Xemdo Xemdo self-requested a review December 22, 2023 20:00
@Xemdo Xemdo merged commit 90a6af4 into twitchdev:main Dec 22, 2023
4 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.

None yet

2 participants