Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@irfan-dahir
Copy link
Contributor

@irfan-dahir irfan-dahir commented Oct 23, 2022

  • This PR updates the parser to the ^4 release
  • Fixes reviews API call for Anime/Manga Reviews, Reviews, User Reviews
  • Adds sort, spoiler, and preliminary filters for Anime/Manga Reviews, and Reviews. (User Reviews does not support this)
  • Update tests
  • Update docs

@irfan-dahir irfan-dahir added feature dependencies Pull requests that update a dependency file labels Oct 23, 2022
@irfan-dahir irfan-dahir added this to the REST 4.0 milestone Oct 23, 2022
@irfan-dahir irfan-dahir self-assigned this Oct 23, 2022
@irfan-dahir irfan-dahir marked this pull request as ready for review October 25, 2022 22:54
@irfan-dahir irfan-dahir requested a review from pushrbx October 25, 2022 22:54
@irfan-dahir irfan-dahir linked an issue Oct 25, 2022 that may be closed by this pull request
@irfan-dahir
Copy link
Contributor Author

irfan-dahir commented Oct 30, 2022

@pushrbx New commits attempt to resolve the repeating of code by refactoring the way the scraper is used and parameters are validated. The implementation could be the starting+testing point for this PR before we put this elsewhere.

I've introduced a QueryResolver class for handling queries that will be passed into the scraper instance. It includes a validation layer with ValidationTypeEnum being the first of its type. It also accepts a custom exception to throw in the event the validation fails. Validation is optional and in this case, is only used for sort.

ScraperHandler bootstraps the QueryResolver along with the getter function name and the respective request object (thanks for the example code!). There are instances where the name of the request class could differ from the getter function of the scraper. So we need to provide their values separately.

A util method, getSerializedJSON(), is also present in ScraperHandler to convert the response object into a serialized JSON.

Let me know what you think.

@irfan-dahir irfan-dahir requested a review from pushrbx October 30, 2022 09:04
@irfan-dahir irfan-dahir requested a review from a team as a code owner November 19, 2022 16:29
@pushrbx pushrbx self-requested a review November 25, 2022 09:34
Copy link
Collaborator

@pushrbx pushrbx left a comment

Choose a reason for hiding this comment

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

Let's do refactoring in a different PR

@irfan-dahir irfan-dahir merged commit 0d714d7 into master Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file feature

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Fix Reviews API endpoints

2 participants