diff --git a/app/Http/Controllers/V4DB/AnimeController.php b/app/Http/Controllers/V4DB/AnimeController.php index b243983..9373605 100644 --- a/app/Http/Controllers/V4DB/AnimeController.php +++ b/app/Http/Controllers/V4DB/AnimeController.php @@ -15,6 +15,7 @@ use App\Http\Resources\V4\MoreInfoResource; use App\Http\Resources\V4\AnimeNewsResource; use App\Http\Resources\V4\PicturesResource; use App\Http\Resources\V4\RecommendationsResource; +use App\Http\Resources\V4\ResultsResource; use App\Http\Resources\V4\ReviewsResource; use App\Http\Resources\V4\AnimeStaffResource; use App\Http\Resources\V4\AnimeStatisticsResource; @@ -120,6 +121,23 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/characters", + * operationId="getAnimeCharacters", + * tags={"anime characters"}, + * + * @OA\Response( + * response="200", + * description="Returns anime characters resource", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function characters(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -175,6 +193,23 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/staff", + * operationId="getAnimeStaff", + * tags={"anime staff"}, + * + * @OA\Response( + * response="200", + * description="Returns anime staff resource", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function staff(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -231,6 +266,23 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/episodes/{mal_id}", + * operationId="getAnimeEpisodeById", + * tags={"anime episode"}, + * + * @OA\Response( + * response="200", + * description="Returns a single anime episode resource", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function episode(Request $request, int $id, int $episodeId) { $results = DB::table($this->getRouteTable($request)) @@ -287,6 +339,96 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/episodes", + * operationId="getAnimeEpisodes", + * tags={"anime episodes"}, + * + * @OA\Response( + * response="200", + * description="Returns a list of anime episodes", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + * + * @OA\Schema( + * schema="anime episodes", + * description="Anime Episodes Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * allOf={ + * @OA\Schema(ref="#/components/schemas/pagination"), + * @OA\Schema( + * @OA\Property( + * property="results", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property( + * property="mal_id", + * type="integer", + * description="MyAnimeList ID" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="title", + * type="string", + * description="Title" + * ), + * @OA\Property( + * property="title_japanese", + * type="string", + * description="Title Japanese" + * ), + * @OA\Property( + * property="title_romanji", + * type="string", + * description="title_romanji" + * ), + * @OA\Property( + * property="duration", + * type="integer", + * description="Episode duration in seconds" + * ), + * @OA\Property( + * property="aired", + * type="string", + * description="Aired Date ISO8601" + * ), + * @OA\Property( + * property="filler", + * type="bool", + * description="Filler episode" + * ), + * @OA\Property( + * property="recap", + * type="bool", + * description="Recap episode" + * ), + * @OA\Property( + * property="synopsis", + * type="string", + * description="Episode Synopsis" + * ), + * ), + * ), + * ), + * } + * ), + * ) + */ public function episodes(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -332,7 +474,7 @@ class AnimeController extends Controller ->get(); } - $response = (new AnimeEpisodesResource( + $response = (new ResultsResource( $results->first() ))->response(); @@ -343,6 +485,38 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/news", + * operationId="getAnimeNews", + * tags={"anime news"}, + * + * @OA\Response( + * response="200", + * description="Returns a list of anime news topics", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + * + * @OA\Schema( + * schema="anime news", + * description="Anime News Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * allOf={ + * @OA\Schema(ref="#/components/schemas/pagination"), + * @OA\Schema(ref="#/components/schemas/news"), + * } + * ), + * ) + */ public function news(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -388,7 +562,7 @@ class AnimeController extends Controller ->get(); } - $response = (new NewsResource( + $response = (new ResultsResource( $results->first() ))->response(); @@ -399,6 +573,23 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/forum", + * operationId="getAnimeTopics", + * tags={"forum"}, + * + * @OA\Response( + * response="200", + * description="Returns a list of anime forum topics", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function forum(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -455,6 +646,23 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/videos", + * operationId="getAnimeVideos", + * tags={"anime videos"}, + * + * @OA\Response( + * response="200", + * description="Returns a list of anime forum topics", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function videos(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -510,6 +718,23 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/pictures", + * operationId="getAnimePictures", + * tags={"pictures"}, + * + * @OA\Response( + * response="200", + * description="Returns a list of anime forum topics", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function pictures(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -565,6 +790,23 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/statistics", + * operationId="getAnimeStatistics", + * tags={"anime statistics"}, + * + * @OA\Response( + * response="200", + * description="Returns anime statistics", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function stats(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -620,6 +862,23 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/moreinfo", + * operationId="getAnimeMoreInfo", + * tags={"moreinfo"}, + * + * @OA\Response( + * response="200", + * description="Returns anime statistics", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function moreInfo(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -675,6 +934,23 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/recommendations", + * operationId="getAnimeRecommendations", + * tags={"recommendations"}, + * + * @OA\Response( + * response="200", + * description="Returns anime recommendations", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function recommendations(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -730,6 +1006,23 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/userupdates", + * operationId="getAnimeUserUpdates", + * tags={"anime userupdates"}, + * + * @OA\Response( + * response="200", + * description="Returns anime recommendations", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function userupdates(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -786,6 +1079,23 @@ class AnimeController extends Controller ); } + /** + * @OA\Get( + * path="/anime/{id}/reviews", + * operationId="getAnimeReviews", + * tags={"anime reviews"}, + * + * @OA\Response( + * response="200", + * description="Returns anime reviews", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function reviews(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) diff --git a/app/Http/Controllers/V4DB/CharacterController.php b/app/Http/Controllers/V4DB/CharacterController.php index b0ba350..a67291f 100644 --- a/app/Http/Controllers/V4DB/CharacterController.php +++ b/app/Http/Controllers/V4DB/CharacterController.php @@ -92,6 +92,23 @@ class CharacterController extends Controller ); } + /** + * @OA\Get( + * path="/characters/{id}/pictures", + * operationId="getCharacterPictures", + * tags={"pictures"}, + * + * @OA\Response( + * response="200", + * description="Returns a list of pictures of the character", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function pictures(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) diff --git a/app/Http/Controllers/V4DB/Controller.php b/app/Http/Controllers/V4DB/Controller.php index f1ee6e1..70a32c9 100644 --- a/app/Http/Controllers/V4DB/Controller.php +++ b/app/Http/Controllers/V4DB/Controller.php @@ -17,13 +17,28 @@ class Controller extends BaseController { /** - * @OA\Info( - * title="Jikan API", - * version="4.0", - * @OA\Contact( - * email="neko@jikan.moe", - * name="Support" - * ) + * @OA\OpenApi( + * @OA\Info( + * version="4.0.0", + * title="Jikan API", + * description="[Jikan](https://jikan.moe) is an **Unofficial** MyAnimeList API. It scrapes the website to satisfy the need for an API - which MyAnimeList lacks.", + * termsOfService="https://jikan.moe/terms", + * @OA\Contact( + * email="neko@jikan.moe" + * ), + * @OA\License( + * name="MIT", + * url="https://github.com/jikan-me/jikan-rest/blob/master/LICENSE" + * ) + * ), + * @OA\Server( + * description="Jikan REST API Alpha", + * url="https://api.jikan.moe/v4-alpha" + * ), + * @OA\ExternalDocumentation( + * description="Find out more about Jikan", + * url="https://jikan.moe" + * ) * ) */ diff --git a/app/Http/Controllers/V4DB/MangaController.php b/app/Http/Controllers/V4DB/MangaController.php index fbf0801..19f4593 100644 --- a/app/Http/Controllers/V4DB/MangaController.php +++ b/app/Http/Controllers/V4DB/MangaController.php @@ -7,6 +7,7 @@ use App\Http\HttpHelper; use App\Http\HttpResponse; use App\Http\Resources\V4\AnimeCharactersResource; use App\Http\Resources\V4\AnimeForumResource; +use App\Http\Resources\V4\ResultsResource; use App\Http\Resources\V4\ReviewsResource; use App\Http\Resources\V4\UserUpdatesResource; use App\Http\Resources\V4\RecommendationsResource; @@ -120,6 +121,23 @@ class MangaController extends Controller ); } + /** + * @OA\Get( + * path="/manga/{id}/characters", + * operationId="getMangaCharacters", + * tags={"manga characters"}, + * + * @OA\Response( + * response="200", + * description="Returns manga characters resource", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function characters(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -175,6 +193,38 @@ class MangaController extends Controller ); } + /** + * @OA\Get( + * path="/manga/{id}/news", + * operationId="getMangaNews", + * tags={"manga news"}, + * + * @OA\Response( + * response="200", + * description="Returns a list of manga news topics", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + * + * @OA\Schema( + * schema="manga news", + * description="Manga News Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * allOf={ + * @OA\Schema(ref="#/components/schemas/pagination"), + * @OA\Schema(ref="#/components/schemas/news"), + * } + * ), + * ) + */ public function news(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -186,7 +236,7 @@ class MangaController extends Controller || $this->isExpired($request, $results) ) { $page = $request->get('page') ?? 1; - $manga = ['articles' => $this->jikan->getNewsList(new MangaNewsRequest($id, $page))]; + $manga = $this->jikan->getNewsList(new MangaNewsRequest($id, $page)); $response = \json_decode($this->serializer->serialize($manga, 'json'), true); if (HttpHelper::hasError($response)) { @@ -220,7 +270,7 @@ class MangaController extends Controller ->get(); } - $response = (new NewsResource( + $response = (new ResultsResource( $results->first() ))->response(); @@ -231,6 +281,23 @@ class MangaController extends Controller ); } + /** + * @OA\Get( + * path="/manga/{id}/forum", + * operationId="getMangaTopics", + * tags={"forum"}, + * + * @OA\Response( + * response="200", + * description="Returns a list of manga forum topics", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function forum(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -287,6 +354,23 @@ class MangaController extends Controller ); } + /** + * @OA\Get( + * path="/manga/{id}/pictures", + * operationId="getMangaPictures", + * tags={"pictures"}, + * + * @OA\Response( + * response="200", + * description="Returns a list of manga forum topics", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function pictures(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -342,6 +426,23 @@ class MangaController extends Controller ); } + /** + * @OA\Get( + * path="/manga/{id}/statistics", + * operationId="getMangaStatistics", + * tags={"manga statistics"}, + * + * @OA\Response( + * response="200", + * description="Returns anime statistics", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function stats(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -397,6 +498,23 @@ class MangaController extends Controller ); } + /** + * @OA\Get( + * path="/manga/{id}/moreinfo", + * operationId="getMangaMoreInfo", + * tags={"moreinfo"}, + * + * @OA\Response( + * response="200", + * description="Returns manga moreinfo", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function moreInfo(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -452,6 +570,23 @@ class MangaController extends Controller ); } + /** + * @OA\Get( + * path="/manga/{id}/recommendations", + * operationId="getMangaRecommendations", + * tags={"recommendations"}, + * + * @OA\Response( + * response="200", + * description="Returns manga recommendations", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function recommendations(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -507,6 +642,23 @@ class MangaController extends Controller ); } + /** + * @OA\Get( + * path="/manga/{id}/userupdates", + * operationId="getMangaUserUpdates", + * tags={"manga userupdates"}, + * + * @OA\Response( + * response="200", + * description="Returns manga user updates", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function userupdates(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -563,6 +715,23 @@ class MangaController extends Controller ); } + /** + * @OA\Get( + * path="/manga/{id}/reviews", + * operationId="getMangaReviews", + * tags={"manga reviews"}, + * + * @OA\Response( + * response="200", + * description="Returns manga reviews", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function reviews(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) diff --git a/app/Http/Controllers/V4DB/PersonController.php b/app/Http/Controllers/V4DB/PersonController.php index ceb4bd6..67b2d23 100644 --- a/app/Http/Controllers/V4DB/PersonController.php +++ b/app/Http/Controllers/V4DB/PersonController.php @@ -91,6 +91,23 @@ class PersonController extends Controller ); } + /** + * @OA\Get( + * path="/people/{id}/pictures", + * operationId="getPersonPictures", + * tags={"pictures"}, + * + * @OA\Response( + * response="200", + * description="Returns a list of pictures of the person", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function pictures(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) diff --git a/app/Http/Controllers/V4DB/SearchController.php b/app/Http/Controllers/V4DB/SearchController.php index d586cf4..e664f04 100644 --- a/app/Http/Controllers/V4DB/SearchController.php +++ b/app/Http/Controllers/V4DB/SearchController.php @@ -45,6 +45,23 @@ class SearchController extends Controller private $request; const MAX_RESULTS_PER_PAGE = 25; + /** + * @OA\Get( + * path="/anime", + * operationId="getAnimeSearch", + * tags={"anime search"}, + * + * @OA\Response( + * response="200", + * description="Returns search results for anime", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function anime(Request $request) { $this->request = $request; @@ -81,6 +98,23 @@ class SearchController extends Controller ); } + /** + * @OA\Get( + * path="/manga", + * operationId="getMangaSearch", + * tags={"manga search"}, + * + * @OA\Response( + * response="200", + * description="Returns search results for manga", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function manga(Request $request) { $this->request = $request; @@ -117,6 +151,23 @@ class SearchController extends Controller ); } + /** + * @OA\Get( + * path="/people", + * operationId="getPeopleSearch", + * tags={"people search"}, + * + * @OA\Response( + * response="200", + * description="Returns search results for people", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function people(Request $request) { $page = $request->get('page') ?? 1; @@ -152,6 +203,23 @@ class SearchController extends Controller ); } + /** + * @OA\Get( + * path="/characters", + * operationId="getCharactersSearch", + * tags={"characters search"}, + * + * @OA\Response( + * response="200", + * description="Returns search results for characters", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function character(Request $request) { $page = $request->get('page') ?? 1; @@ -187,6 +255,23 @@ class SearchController extends Controller ); } + /** + * @OA\Get( + * path="/users", + * operationId="getUsersSearch", + * tags={"users search"}, + * + * @OA\Response( + * response="200", + * description="Returns search results for users", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function users(Request $request) { $results = DB::table($this->getRouteTable($request)) @@ -246,6 +331,23 @@ class SearchController extends Controller ); } + /** + * @OA\Get( + * path="/userbyid", + * operationId="getUserById", + * tags={"user by id search"}, + * + * @OA\Response( + * response="200", + * description="Returns username by ID search", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function userById(Request $request, int $id) { $results = DB::table($this->getRouteTable($request)) @@ -301,6 +403,23 @@ class SearchController extends Controller ); } + /** + * @OA\Get( + * path="/clubs", + * operationId="getClubsSearch", + * tags={"clubs search"}, + * + * @OA\Response( + * response="200", + * description="Returns search results for clubs", + * @OA\JsonContent() + * ), + * @OA\Response( + * response="400", + * description="Error: Bad request. When required parameters were not supplied.", + * ), + * ) + */ public function clubs(Request $request) { $this->request = $request; diff --git a/app/Http/Resources/V4/AnimeCharactersResource.php b/app/Http/Resources/V4/AnimeCharactersResource.php index 9cc34c2..cccb046 100644 --- a/app/Http/Resources/V4/AnimeCharactersResource.php +++ b/app/Http/Resources/V4/AnimeCharactersResource.php @@ -6,6 +6,67 @@ use Illuminate\Http\Resources\Json\JsonResource; class AnimeCharactersResource extends JsonResource { + /** + * @OA\Schema( + * schema="anime characters", + * description="Anime Characters Resource", + * + * @OA\Property( + * property="data", + * type="array", + * @OA\Items( + * type="object", + * + * @OA\Property( + * property="mal_id", + * type="integer", + * description="MyAnimeList ID" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="image_url", + * type="string", + * description="Image URL" + * ), + * @OA\Property( + * property="name", + * type="string", + * description="Character Name" + * ), + * @OA\Property( + * property="role", + * type="string", + * description="Character's Role" + * ), + * @OA\Property( + * property="voice_actors", + * type="array", + * @OA\Items( + * type="object", + * allOf={ + * @OA\Schema(ref="#/components/schemas/mal_url"), + * @OA\Schema( + * @OA\Property( + * property="image_url", + * type="string", + * ), + * @OA\Property( + * property="language", + * type="string", + * ), + * ), + * }, + * ), + * ), + * ), + * ), + * ) + */ + /** * Transform the resource into an array. * diff --git a/app/Http/Resources/V4/AnimeCollection.php b/app/Http/Resources/V4/AnimeCollection.php index 249c5b6..4b540a3 100644 --- a/app/Http/Resources/V4/AnimeCollection.php +++ b/app/Http/Resources/V4/AnimeCollection.php @@ -12,6 +12,21 @@ class AnimeCollection extends ResourceCollection * The resource that this resource collects. * * @var string + * + * @OA\Schema( + * schema="anime search", + * description="Anime Search Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * allOf={ + * @OA\Schema(ref="#/components/schemas/pagination"), + * @OA\Schema(ref="#/components/schemas/anime"), + * } + * ), + * ) */ public $collects = 'App\Http\Resources\V4\AnimeResource'; diff --git a/app/Http/Resources/V4/AnimeEpisodeResource.php b/app/Http/Resources/V4/AnimeEpisodeResource.php index 75affd2..c405ddd 100644 --- a/app/Http/Resources/V4/AnimeEpisodeResource.php +++ b/app/Http/Resources/V4/AnimeEpisodeResource.php @@ -6,6 +6,68 @@ use Illuminate\Http\Resources\Json\JsonResource; class AnimeEpisodeResource extends JsonResource { + /** + * @OA\Schema( + * schema="anime episode", + * description="Anime Episode Resource", + * + * @OA\Property( + * property="data", + * type="object", + * @OA\Property( + * property="mal_id", + * type="integer", + * description="MyAnimeList ID" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="title", + * type="string", + * description="Title" + * ), + * @OA\Property( + * property="title_japanese", + * type="string", + * description="Title Japanese" + * ), + * @OA\Property( + * property="title_romanji", + * type="string", + * description="title_romanji" + * ), + * @OA\Property( + * property="duration", + * type="integer", + * description="Episode duration in seconds" + * ), + * @OA\Property( + * property="aired", + * type="string", + * description="Aired Date ISO8601" + * ), + * @OA\Property( + * property="filler", + * type="bool", + * description="Filler episode" + * ), + * @OA\Property( + * property="recap", + * type="bool", + * description="Recap episode" + * ), + * @OA\Property( + * property="synopsis", + * type="string", + * description="Episode Synopsis" + * ), + * ), + * ) + */ + /** * Transform the resource into an array. * diff --git a/app/Http/Resources/V4/AnimeEpisodesResource.php b/app/Http/Resources/V4/AnimeEpisodesResource.php index 0694124..7ca4269 100644 --- a/app/Http/Resources/V4/AnimeEpisodesResource.php +++ b/app/Http/Resources/V4/AnimeEpisodesResource.php @@ -15,9 +15,9 @@ class AnimeEpisodesResource extends JsonResource public function toArray($request) { return [ - 'last_visible_page' => $this['episodes_last_page'], + 'last_visible_page' => $this['last_visible_page'] ?? 1, 'has_next_page' => $this['has_next_page'] ?? false, - 'episodes' => $this['episodes'] + 'results' => $this['results'] ]; } } \ No newline at end of file diff --git a/app/Http/Resources/V4/AnimeStaffResource.php b/app/Http/Resources/V4/AnimeStaffResource.php index e7a929d..a4da465 100644 --- a/app/Http/Resources/V4/AnimeStaffResource.php +++ b/app/Http/Resources/V4/AnimeStaffResource.php @@ -6,6 +6,44 @@ use Illuminate\Http\Resources\Json\JsonResource; class AnimeStaffResource extends JsonResource { + + /** + * @OA\Schema( + * schema="anime staff", + * description="Anime Staff Resource", + * + * @OA\Property( + * property="data", + * type="array", + * @OA\Items( + * type="object", + * + * @OA\Property( + * property="mal_id", + * type="integer", + * description="MyAnimeList ID" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="name", + * type="string", + * description="Name" + * ), + * @OA\Property( + * property="positions", + * type="array", + * description="Staff Positions", + * @OA\Items(type="string") + * ), + * ), + * ), + * ) + */ + /** * Transform the resource into an array. * diff --git a/app/Http/Resources/V4/AnimeStatisticsResource.php b/app/Http/Resources/V4/AnimeStatisticsResource.php index c71ccf6..ac665c5 100644 --- a/app/Http/Resources/V4/AnimeStatisticsResource.php +++ b/app/Http/Resources/V4/AnimeStatisticsResource.php @@ -11,6 +11,70 @@ class AnimeStatisticsResource extends JsonResource * * @param \Illuminate\Http\Request $request * @return array + * + * @OA\Schema( + * schema="anime statistics", + * description="Anime Statistics Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * @OA\Property( + * property="watching", + * type="integer", + * description="Number of users watching the resource" + * ), + * @OA\Property( + * property="completed", + * type="integer", + * description="Number of users who have completed the resource" + * ), + * @OA\Property( + * property="on_hold", + * type="integer", + * description="Number of users who have put the resource on hold" + * ), + * @OA\Property( + * property="dropped", + * type="integer", + * description="Number of users who have dropped the resource" + * ), + * @OA\Property( + * property="plan_to_watch", + * type="integer", + * description="Number of users who have planned to watch the resource" + * ), + * @OA\Property( + * property="total", + * type="integer", + * description="Total number of users who have the resource added to their lists" + * ), + * + * @OA\Property( + * property="scores", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property( + * property="score", + * type="integer", + * description="The number Score" + * ), + * @OA\Property( + * property="votes", + * type="integer", + * description="Number of votes for this score" + * ), + * @OA\Property( + * property="percentage", + * type="float", + * description="Percentage of votes for this score" + * ), + * ), + * ), + * ), + * ) */ public function toArray($request) { diff --git a/app/Http/Resources/V4/AnimeVideosResource.php b/app/Http/Resources/V4/AnimeVideosResource.php index eb13b79..0da7904 100644 --- a/app/Http/Resources/V4/AnimeVideosResource.php +++ b/app/Http/Resources/V4/AnimeVideosResource.php @@ -11,6 +11,71 @@ class AnimeVideosResource extends JsonResource * * @param \Illuminate\Http\Request $request * @return array + * + * @OA\Schema( + * schema="anime videos", + * description="Anime Videos Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * @OA\Property( + * property="promos", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property( + * property="title", + * type="string", + * description="Title" + * ), + * @OA\Property( + * property="image_url", + * type="string", + * description="Image URL" + * ), + * @OA\Property( + * property="trailer", + * ref="#/components/schemas/trailer" + * ), + * ), + * ), + * @OA\Property( + * property="episodes", + * type="array", + * + * @OA\Items( + * type="object", + * @OA\Property( + * property="mal_id", + * type="integer", + * description="MyAnimeList ID" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="title", + * type="string", + * description="Title" + * ), + * @OA\Property( + * property="episode", + * type="string", + * description="Episode" + * ), + * @OA\Property( + * property="image_url", + * type="string", + * description="Image URL" + * ), + * ), + * ), + * ), + * ) */ public function toArray($request) { diff --git a/app/Http/Resources/V4/CharacterCollection.php b/app/Http/Resources/V4/CharacterCollection.php index 1b5394f..e33c51a 100644 --- a/app/Http/Resources/V4/CharacterCollection.php +++ b/app/Http/Resources/V4/CharacterCollection.php @@ -12,6 +12,21 @@ class CharacterCollection extends ResourceCollection * The resource that this resource collects. * * @var string + * + * @OA\Schema( + * schema="characters search", + * description="Characters Search Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * allOf={ + * @OA\Schema(ref="#/components/schemas/pagination"), + * @OA\Schema(ref="#/components/schemas/character"), + * } + * ), + * ) */ public $collects = 'App\Http\Resources\V4\CharacterResource'; diff --git a/app/Http/Resources/V4/CommonResource.php b/app/Http/Resources/V4/CommonResource.php index d691a35..d387457 100644 --- a/app/Http/Resources/V4/CommonResource.php +++ b/app/Http/Resources/V4/CommonResource.php @@ -27,6 +27,35 @@ class CommonResource extends JsonResource * type="string", * description="Parsed Embed URL" * ), + * @OA\Property( + * property="images", + * type="object", + * @OA\Property( + * property="image_url", + * type="string", + * description="Default Image Size URL (120x90)" + * ), + * @OA\Property( + * property="small_image_url", + * type="string", + * description="Small Image Size URL (640x480)" + * ), + * @OA\Property( + * property="medium_image_url", + * type="string", + * description="Medium Image Size URL (320x180)" + * ), + * @OA\Property( + * property="large_image_url", + * type="string", + * description="Large Image Size URL (480x360)" + * ), + * @OA\Property( + * property="maximum_image_url", + * type="string", + * description="Maximum Image Size URL (1280x720)" + * ), + * ), * ), * * @OA\Schema( @@ -173,5 +202,80 @@ class CommonResource extends JsonResource * ), * ), * ), + * + * @OA\Schema( + * schema="pagination", + * type="object", + * @OA\Property( + * property="last_visible_page", + * type="integer" + * ), + * @OA\Property( + * property="has_next_page", + * type="bool" + * ), + * ), + * + * @OA\Schema( + * schema="news", + * type="object", + * @OA\Property( + * property="results", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property( + * property="mal_id", + * type="integer", + * description="MyAnimeList ID" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="title", + * type="string", + * description="Title" + * ), + * @OA\Property( + * property="date", + * type="string", + * description="Post Date ISO8601" + * ), + * @OA\Property( + * property="author_username", + * type="string", + * description="Author MyAnimeList Username" + * ), + * @OA\Property( + * property="author_url", + * type="string", + * description="Author Profile URL" + * ), + * @OA\Property( + * property="forum_url", + * type="string", + * description="Forum topic URL" + * ), + * @OA\Property( + * property="image_url", + * type="string", + * description="Image URL" + * ), + * @OA\Property( + * property="comments", + * type="integer", + * description="Comment count" + * ), + * @OA\Property( + * property="excerpt", + * type="string", + * description="Excerpt" + * ), + * ), + * ), + * ), */ } \ No newline at end of file diff --git a/app/Http/Resources/V4/ForumResource.php b/app/Http/Resources/V4/ForumResource.php index bbb7a4f..7f3adc2 100644 --- a/app/Http/Resources/V4/ForumResource.php +++ b/app/Http/Resources/V4/ForumResource.php @@ -11,6 +11,80 @@ class ForumResource extends JsonResource * * @param \Illuminate\Http\Request $request * @return array + * + * @OA\Schema( + * schema="forum", + * description="Forum Resource", + * + * @OA\Property( + * property="data", + * type="array", + * + * @OA\Items( + * type="object", + * @OA\Property( + * property="mal_id", + * type="integer", + * description="MyAnimeList ID" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="title", + * type="string", + * description="Title" + * ), + * @OA\Property( + * property="date", + * type="string", + * description="Post Date ISO8601" + * ), + * @OA\Property( + * property="author_username", + * type="string", + * description="Author MyAnimeList Username" + * ), + * @OA\Property( + * property="author_url", + * type="string", + * description="Author Profile URL" + * ), + * @OA\Property( + * property="comments", + * type="integer", + * description="Comment count" + * ), + * @OA\Property( + * property="last_comment", + * type="object", + * description="Last comment details", + * @OA\Property( + * property="url", + * type="string", + * description="Last comment URL" + * ), + * @OA\Property( + * property="author_username", + * type="string", + * description="Author MyAnimeList Username" + * ), + * @OA\Property( + * property="author_url", + * type="string", + * description="Author Profile URL" + * ), + * @OA\Property( + * property="date", + * type="string", + * description="Last comment date posted ISO8601" + * ), + * ), + * ), + * ), + * ) */ public function toArray($request) { diff --git a/app/Http/Resources/V4/MangaCharactersResource.php b/app/Http/Resources/V4/MangaCharactersResource.php index d3f6da2..7881c04 100644 --- a/app/Http/Resources/V4/MangaCharactersResource.php +++ b/app/Http/Resources/V4/MangaCharactersResource.php @@ -11,6 +11,45 @@ class MangaCharactersResource extends JsonResource * * @param \Illuminate\Http\Request $request * @return array + * + * @OA\Schema( + * schema="manga characters", + * description="Manga Characters Resource", + * + * @OA\Property( + * property="data", + * type="array", + * @OA\Items( + * type="object", + * + * @OA\Property( + * property="mal_id", + * type="integer", + * description="MyAnimeList ID" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="image_url", + * type="string", + * description="Image URL" + * ), + * @OA\Property( + * property="name", + * type="string", + * description="Character Name" + * ), + * @OA\Property( + * property="role", + * type="string", + * description="Character's Role" + * ), + * ), + * ), + * ) */ public function toArray($request) { diff --git a/app/Http/Resources/V4/MangaCollection.php b/app/Http/Resources/V4/MangaCollection.php index 7ea5f5a..728ef38 100644 --- a/app/Http/Resources/V4/MangaCollection.php +++ b/app/Http/Resources/V4/MangaCollection.php @@ -12,6 +12,21 @@ class MangaCollection extends ResourceCollection * The resource that this resource collects. * * @var string + * + * @OA\Schema( + * schema="manga search", + * description="Manga Search Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * allOf={ + * @OA\Schema(ref="#/components/schemas/pagination"), + * @OA\Schema(ref="#/components/schemas/manga"), + * } + * ), + * ) */ public $collects = 'App\Http\Resources\V4\MangaResource'; diff --git a/app/Http/Resources/V4/MangaStatisticsResource.php b/app/Http/Resources/V4/MangaStatisticsResource.php index 8bb03f3..218dbbd 100644 --- a/app/Http/Resources/V4/MangaStatisticsResource.php +++ b/app/Http/Resources/V4/MangaStatisticsResource.php @@ -11,6 +11,70 @@ class MangaStatisticsResource extends JsonResource * * @param \Illuminate\Http\Request $request * @return array + * + * @OA\Schema( + * schema="manga statistics", + * description="Manga Statistics Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * @OA\Property( + * property="reading", + * type="integer", + * description="Number of users reading the resource" + * ), + * @OA\Property( + * property="completed", + * type="integer", + * description="Number of users who have completed the resource" + * ), + * @OA\Property( + * property="on_hold", + * type="integer", + * description="Number of users who have put the resource on hold" + * ), + * @OA\Property( + * property="dropped", + * type="integer", + * description="Number of users who have dropped the resource" + * ), + * @OA\Property( + * property="plan_to_read", + * type="integer", + * description="Number of users who have planned to read the resource" + * ), + * @OA\Property( + * property="total", + * type="integer", + * description="Total number of users who have the resource added to their lists" + * ), + * + * @OA\Property( + * property="scores", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property( + * property="score", + * type="integer", + * description="The number Score" + * ), + * @OA\Property( + * property="votes", + * type="integer", + * description="Number of votes for this score" + * ), + * @OA\Property( + * property="percentage", + * type="float", + * description="Percentage of votes for this score" + * ), + * ), + * ), + * ), + * ) */ public function toArray($request) { diff --git a/app/Http/Resources/V4/MoreInfoResource.php b/app/Http/Resources/V4/MoreInfoResource.php index 7aed337..e79e60a 100644 --- a/app/Http/Resources/V4/MoreInfoResource.php +++ b/app/Http/Resources/V4/MoreInfoResource.php @@ -11,6 +11,22 @@ class MoreInfoResource extends JsonResource * * @param \Illuminate\Http\Request $request * @return array + * + * @OA\Schema( + * schema="moreinfo", + * description="More Info Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * @OA\Property( + * property="moreinfo", + * type="string", + * description="Additional information on the entry" + * ), + * ), + * ) */ public function toArray($request) { diff --git a/app/Http/Resources/V4/PersonCollection.php b/app/Http/Resources/V4/PersonCollection.php index c5b6487..a68f3f8 100644 --- a/app/Http/Resources/V4/PersonCollection.php +++ b/app/Http/Resources/V4/PersonCollection.php @@ -12,6 +12,21 @@ class PersonCollection extends ResourceCollection * The resource that this resource collects. * * @var string + * + * @OA\Schema( + * schema="people search", + * description="People Search Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * allOf={ + * @OA\Schema(ref="#/components/schemas/pagination"), + * @OA\Schema(ref="#/components/schemas/person"), + * } + * ), + * ) */ public $collects = 'App\Http\Resources\V4\PersonResource'; diff --git a/app/Http/Resources/V4/PicturesResource.php b/app/Http/Resources/V4/PicturesResource.php index 398b04d..ecbea43 100644 --- a/app/Http/Resources/V4/PicturesResource.php +++ b/app/Http/Resources/V4/PicturesResource.php @@ -11,6 +11,51 @@ class PicturesResource extends JsonResource * * @param \Illuminate\Http\Request $request * @return array + * + * @OA\Schema( + * schema="pictures", + * description="Pictures Resource", + * + * @OA\Property( + * property="data", + * type="object", + * + * @OA\Property( + * property="jpg", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property( + * property="image_url", + * type="string", + * description="Default JPG Image Size URL" + * ), + * @OA\Property( + * property="large_image_url", + * type="string", + * description="Large JPG Image Size URL" + * ), + * ), + * ), + * @OA\Property( + * property="webp", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property( + * property="image_url", + * type="string", + * description="Default JPG Image Size URL" + * ), + * @OA\Property( + * property="large_image_url", + * type="string", + * description="Large JPG Image Size URL" + * ), + * ), + * ), + * ), + * ) */ public function toArray($request) { diff --git a/app/Http/Resources/V4/RecommendationsResource.php b/app/Http/Resources/V4/RecommendationsResource.php index 5759ea9..dc2166f 100644 --- a/app/Http/Resources/V4/RecommendationsResource.php +++ b/app/Http/Resources/V4/RecommendationsResource.php @@ -11,6 +11,45 @@ class RecommendationsResource extends JsonResource * * @param \Illuminate\Http\Request $request * @return array + * + * @OA\Schema( + * schema="recommendations", + * description="Recommendations Resource", + * + * @OA\Property( + * property="data", + * type="array", + * + * @OA\Items( + * type="object", + * @OA\Property( + * property="mal_id", + * type="integer", + * description="Recommended MyAnimeList ID" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="Recommended MyAnimeList URL" + * ), + * @OA\Property( + * property="recommendation_url", + * type="string", + * description="Recommendation MyAnimeList URL" + * ), + * @OA\Property( + * property="title", + * type="string", + * description="Recommended Entry Title" + * ), + * @OA\Property( + * property="recommendation_count", + * type="integer", + * description="Number of users who have recommended this entry" + * ), + * ), + * ), + * ) */ public function toArray($request) { diff --git a/app/Http/Resources/V4/ReviewsResource.php b/app/Http/Resources/V4/ReviewsResource.php index 4f8c5a2..f1823d7 100644 --- a/app/Http/Resources/V4/ReviewsResource.php +++ b/app/Http/Resources/V4/ReviewsResource.php @@ -6,6 +6,211 @@ use Illuminate\Http\Resources\Json\JsonResource; class ReviewsResource extends JsonResource { + /** + * @OA\Schema( + * schema="anime reviews", + * description="Anime Reviews Resource", + * + * @OA\Property( + * property="data", + * type="array", + * + * @OA\Items( + * type="object", + * @OA\Property( + * property="mal_id", + * type="integer", + * description="MyAnimeList ID" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="type", + * type="string", + * description="Entry Type" + * ), + * @OA\Property( + * property="votes", + * type="integer", + * description="Number of user votes on the Review" + * ), + * @OA\Property( + * property="date", + * type="string", + * description="Review created date ISO8601" + * ), + * @OA\Property( + * property="scores", + * type="object", + * description="Review Scores breakdown", + * @OA\Property( + * property="overall", + * type="integer", + * description="Overall Score" + * ), + * @OA\Property( + * property="story", + * type="integer", + * description="Story Score" + * ), + * @OA\Property( + * property="animation", + * type="integer", + * description="Animation Score" + * ), + * @OA\Property( + * property="sound", + * type="integer", + * description="Sound Score" + * ), + * @OA\Property( + * property="character", + * type="integer", + * description="Character Score" + * ), + * @OA\Property( + * property="enjoyment", + * type="integer", + * description="Enjoyment Score" + * ), + * ), + * @OA\Property( + * property="review", + * type="string", + * description="Review content" + * ), + * @OA\Property( + * property="reviewer", + * type="object", + * description="Reviewer details", + * @OA\Property( + * property="username", + * type="string", + * description="MyAnimeList Username" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList Profile URL" + * ), + * @OA\Property( + * property="image_url", + * type="string", + * description="User Display Picture Image URL" + * ), + * @OA\Property( + * property="episodes_seen", + * type="integer", + * description="Number of episodes seen" + * ), + * ), + * ), + * ), + * ), + * + * @OA\Schema( + * schema="manga reviews", + * description="Manga Reviews Resource", + * + * @OA\Property( + * property="data", + * type="array", + * + * @OA\Items( + * type="object", + * @OA\Property( + * property="mal_id", + * type="integer", + * description="MyAnimeList ID" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="type", + * type="string", + * description="Entry Type" + * ), + * @OA\Property( + * property="votes", + * type="integer", + * description="Number of user votes on the Review" + * ), + * @OA\Property( + * property="date", + * type="string", + * description="Review created date ISO8601" + * ), + * @OA\Property( + * property="scores", + * type="object", + * description="Review Scores breakdown", + * @OA\Property( + * property="overall", + * type="integer", + * description="Overall Score" + * ), + * @OA\Property( + * property="story", + * type="integer", + * description="Story Score" + * ), + * @OA\Property( + * property="art", + * type="integer", + * description="Art Score" + * ), + * @OA\Property( + * property="character", + * type="integer", + * description="Character Score" + * ), + * @OA\Property( + * property="enjoyment", + * type="integer", + * description="Enjoyment Score" + * ), + * ), + * @OA\Property( + * property="review", + * type="string", + * description="Review content" + * ), + * @OA\Property( + * property="reviewer", + * type="object", + * description="Reviewer details", + * @OA\Property( + * property="username", + * type="string", + * description="MyAnimeList Username" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList Profile URL" + * ), + * @OA\Property( + * property="image_url", + * type="string", + * description="User Display Picture Image URL" + * ), + * @OA\Property( + * property="episodes_seen", + * type="integer", + * description="Number of episodes seen" + * ), + * ), + * ), + * ), + * ) + */ + /** * Transform the resource into an array. * diff --git a/app/Http/Resources/V4/UserUpdatesResource.php b/app/Http/Resources/V4/UserUpdatesResource.php index 7a961ba..925fdeb 100644 --- a/app/Http/Resources/V4/UserUpdatesResource.php +++ b/app/Http/Resources/V4/UserUpdatesResource.php @@ -11,6 +11,124 @@ class UserUpdatesResource extends JsonResource * * @param \Illuminate\Http\Request $request * @return array + * + * @OA\Schema( + * schema="anime userupdates", + * description="Anime User Updates Resource", + * + * @OA\Property( + * property="data", + * type="array", + * + * @OA\Items( + * type="object", + * @OA\Property( + * property="username", + * type="string", + * description="MyAnimeList Username" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="image_url", + * type="string", + * description="Image URL" + * ), + * @OA\Property( + * property="score", + * type="integer", + * description="User Score" + * ), + * @OA\Property( + * property="status", + * type="string", + * description="User list status" + * ), + * @OA\Property( + * property="episodes_seen", + * type="integer", + * description="Number of episodes seen" + * ), + * @OA\Property( + * property="episodes_total", + * type="integer", + * description="Total number of episodes" + * ), + * @OA\Property( + * property="date", + * type="string", + * description="Last updated date ISO8601" + * ), + * ), + * ), + * ), + * + * @OA\Schema( + * schema="manga userupdates", + * description="Manga User Updates Resource", + * + * @OA\Property( + * property="data", + * type="array", + * + * @OA\Items( + * type="object", + * @OA\Property( + * property="username", + * type="string", + * description="MyAnimeList Username" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="MyAnimeList URL" + * ), + * @OA\Property( + * property="image_url", + * type="string", + * description="Image URL" + * ), + * @OA\Property( + * property="score", + * type="integer", + * description="User Score" + * ), + * @OA\Property( + * property="status", + * type="string", + * description="User list status" + * ), + * @OA\Property( + * property="volumes_read", + * type="integer", + * description="Number of volumes read" + * ), + * @OA\Property( + * property="volumes_total", + * type="integer", + * description="Total number of volumes" + * ), + * @OA\Property( + * property="chapters_read", + * type="integer", + * description="Number of chapters read" + * ), + * @OA\Property( + * property="chapters_total", + * type="integer", + * description="Total number of chapters" + * ), + * @OA\Property( + * property="date", + * type="string", + * description="Last updated date ISO8601" + * ), + * ), + * ), + * ) */ public function toArray($request) { diff --git a/bootstrap/app.php b/bootstrap/app.php index 76b19b7..043cfd4 100755 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -155,12 +155,12 @@ $commonMiddleware = [ // 'source-data-manager' ]; + $app->router->group( [ - 'prefix' => 'v4', + 'prefix' => 'v4-alpha', 'namespace' => env('SOURCE') === 'local' ? 'App\Http\Controllers\V4DB' : 'App\Http\Controllers\V4', 'middleware' => $commonMiddleware - ], function ($router) { require __DIR__.'/../routes/web.v4.php'; diff --git a/database/migrations/2020_05_21_051725_create_index.php b/database/migrations/2020_05_21_051725_create_index.php index d2c7139..2e74ace 100644 --- a/database/migrations/2020_05_21_051725_create_index.php +++ b/database/migrations/2020_05_21_051725_create_index.php @@ -18,10 +18,11 @@ class CreateIndex extends Migration */ public function up() { - $mappings = config('controller-to-table-mapping'); + $mappings = config('controller'); $mapped = []; - foreach ($mappings as $table) { + foreach ($mappings as $controller) { + $table = $controller['table_name']; if (in_array($table, $mapped) || in_array($table, self::IGNORE) || Schema::hasTable($table)) { continue; } diff --git a/database/migrations/2020_07_10_182531_create_magazines_table.php b/database/migrations/2020_07_10_182531_create_magazines_table.php index dbd44d3..5e6b48a 100644 --- a/database/migrations/2020_07_10_182531_create_magazines_table.php +++ b/database/migrations/2020_07_10_182531_create_magazines_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateMagazineTable extends Migration +class CreateMagazinesTable extends Migration { /** * Run the migrations. diff --git a/storage/api-docs/api-docs.json b/storage/api-docs/api-docs.json index 8bdb8f0..f056c34 100644 --- a/storage/api-docs/api-docs.json +++ b/storage/api-docs/api-docs.json @@ -2,12 +2,23 @@ "openapi": "3.0.0", "info": { "title": "Jikan API", + "description": "[Jikan](https://jikan.moe) is an **Unofficial** MyAnimeList API. It scrapes the website to satisfy the need for an API - which MyAnimeList lacks.", + "termsOfService": "https://jikan.moe/terms", "contact": { - "name": "Support", "email": "neko@jikan.moe" }, - "version": "4.0" + "license": { + "name": "MIT", + "url": "https://github.com/jikan-me/jikan-rest/blob/master/LICENSE" + }, + "version": "4.0.0" }, + "servers": [ + { + "url": "https://api.jikan.moe/v4-alpha", + "description": "Jikan REST API Alpha" + } + ], "paths": { "/anime/{id}": { "get": { @@ -30,6 +41,279 @@ } } }, + "/anime/{id}/characters": { + "get": { + "tags": [ + "anime characters" + ], + "operationId": "getAnimeCharacters", + "responses": { + "200": { + "description": "Returns anime characters resource", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/staff": { + "get": { + "tags": [ + "anime staff" + ], + "operationId": "getAnimeStaff", + "responses": { + "200": { + "description": "Returns anime staff resource", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/episodes/{mal_id}": { + "get": { + "tags": [ + "anime episode" + ], + "operationId": "getAnimeEpisodeById", + "responses": { + "200": { + "description": "Returns a single anime episode resource", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/episodes": { + "get": { + "tags": [ + "anime episodes" + ], + "operationId": "getAnimeEpisodes", + "responses": { + "200": { + "description": "Returns a list of anime episodes", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/news": { + "get": { + "tags": [ + "anime news" + ], + "operationId": "getAnimeNews", + "responses": { + "200": { + "description": "Returns a list of anime news topics", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/forum": { + "get": { + "tags": [ + "forum" + ], + "operationId": "getAnimeTopics", + "responses": { + "200": { + "description": "Returns a list of anime forum topics", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/videos": { + "get": { + "tags": [ + "anime videos" + ], + "operationId": "getAnimeVideos", + "responses": { + "200": { + "description": "Returns a list of anime forum topics", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/pictures": { + "get": { + "tags": [ + "pictures" + ], + "operationId": "getAnimePictures", + "responses": { + "200": { + "description": "Returns a list of anime forum topics", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/statistics": { + "get": { + "tags": [ + "anime statistics" + ], + "operationId": "getAnimeStatistics", + "responses": { + "200": { + "description": "Returns anime statistics", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/moreinfo": { + "get": { + "tags": [ + "moreinfo" + ], + "operationId": "getAnimeMoreInfo", + "responses": { + "200": { + "description": "Returns anime statistics", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/recommendations": { + "get": { + "tags": [ + "recommendations" + ], + "operationId": "getAnimeRecommendations", + "responses": { + "200": { + "description": "Returns anime recommendations", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/userupdates": { + "get": { + "tags": [ + "anime userupdates" + ], + "operationId": "getAnimeUserUpdates", + "responses": { + "200": { + "description": "Returns anime recommendations", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime/{id}/reviews": { + "get": { + "tags": [ + "anime reviews" + ], + "operationId": "getAnimeReviews", + "responses": { + "200": { + "description": "Returns anime reviews", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, "/characters/{id}": { "get": { "tags": [ @@ -51,6 +335,27 @@ } } }, + "/characters/{id}/pictures": { + "get": { + "tags": [ + "pictures" + ], + "operationId": "getCharacterPictures", + "responses": { + "200": { + "description": "Returns a list of pictures of the character", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, "/manga/{id}": { "get": { "tags": [ @@ -72,6 +377,195 @@ } } }, + "/manga/{id}/characters": { + "get": { + "tags": [ + "manga characters" + ], + "operationId": "getMangaCharacters", + "responses": { + "200": { + "description": "Returns manga characters resource", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/manga/{id}/news": { + "get": { + "tags": [ + "manga news" + ], + "operationId": "getMangaNews", + "responses": { + "200": { + "description": "Returns a list of manga news topics", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/manga/{id}/forum": { + "get": { + "tags": [ + "forum" + ], + "operationId": "getMangaTopics", + "responses": { + "200": { + "description": "Returns a list of manga forum topics", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/manga/{id}/pictures": { + "get": { + "tags": [ + "pictures" + ], + "operationId": "getMangaPictures", + "responses": { + "200": { + "description": "Returns a list of manga forum topics", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/manga/{id}/statistics": { + "get": { + "tags": [ + "manga statistics" + ], + "operationId": "getMangaStatistics", + "responses": { + "200": { + "description": "Returns anime statistics", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/manga/{id}/moreinfo": { + "get": { + "tags": [ + "moreinfo" + ], + "operationId": "getMangaMoreInfo", + "responses": { + "200": { + "description": "Returns manga moreinfo", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/manga/{id}/recommendations": { + "get": { + "tags": [ + "recommendations" + ], + "operationId": "getMangaRecommendations", + "responses": { + "200": { + "description": "Returns manga recommendations", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/manga/{id}/userupdates": { + "get": { + "tags": [ + "manga userupdates" + ], + "operationId": "getMangaUserUpdates", + "responses": { + "200": { + "description": "Returns manga user updates", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/manga/{id}/reviews": { + "get": { + "tags": [ + "manga reviews" + ], + "operationId": "getMangaReviews", + "responses": { + "200": { + "description": "Returns manga reviews", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, "/people/{id}": { "get": { "tags": [ @@ -92,10 +586,404 @@ } } } + }, + "/people/{id}/pictures": { + "get": { + "tags": [ + "pictures" + ], + "operationId": "getPersonPictures", + "responses": { + "200": { + "description": "Returns a list of pictures of the person", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/anime": { + "get": { + "tags": [ + "anime search" + ], + "operationId": "getAnimeSearch", + "responses": { + "200": { + "description": "Returns search results for anime", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/manga": { + "get": { + "tags": [ + "manga search" + ], + "operationId": "getMangaSearch", + "responses": { + "200": { + "description": "Returns search results for manga", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/people": { + "get": { + "tags": [ + "people search" + ], + "operationId": "getPeopleSearch", + "responses": { + "200": { + "description": "Returns search results for people", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/characters": { + "get": { + "tags": [ + "characters search" + ], + "operationId": "getCharactersSearch", + "responses": { + "200": { + "description": "Returns search results for characters", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/users": { + "get": { + "tags": [ + "users search" + ], + "operationId": "getUsersSearch", + "responses": { + "200": { + "description": "Returns search results for users", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/userbyid": { + "get": { + "tags": [ + "user by id search" + ], + "operationId": "getUserById", + "responses": { + "200": { + "description": "Returns username by ID search", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, + "/clubs": { + "get": { + "tags": [ + "clubs search" + ], + "operationId": "getClubsSearch", + "responses": { + "200": { + "description": "Returns search results for clubs", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } } }, "components": { "schemas": { + "anime episodes": { + "description": "Anime Episodes Resource", + "properties": { + "data": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/pagination" + }, + { + "properties": { + "results": { + "type": "array", + "items": { + "properties": { + "mal_id": { + "description": "MyAnimeList ID", + "type": "integer" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "title": { + "description": "Title", + "type": "string" + }, + "title_japanese": { + "description": "Title Japanese", + "type": "string" + }, + "title_romanji": { + "description": "title_romanji", + "type": "string" + }, + "duration": { + "description": "Episode duration in seconds", + "type": "integer" + }, + "aired": { + "description": "Aired Date ISO8601", + "type": "string" + }, + "filler": { + "description": "Filler episode", + "type": "bool" + }, + "recap": { + "description": "Recap episode", + "type": "bool" + }, + "synopsis": { + "description": "Episode Synopsis", + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + } + ] + } + }, + "type": "object" + }, + "anime news": { + "description": "Anime News Resource", + "properties": { + "data": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/pagination" + }, + { + "$ref": "#/components/schemas/news" + } + ] + } + }, + "type": "object" + }, + "manga news": { + "description": "Manga News Resource", + "properties": { + "data": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/pagination" + }, + { + "$ref": "#/components/schemas/news" + } + ] + } + }, + "type": "object" + }, + "anime characters": { + "description": "Anime Characters Resource", + "properties": { + "data": { + "type": "array", + "items": { + "properties": { + "mal_id": { + "description": "MyAnimeList ID", + "type": "integer" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "image_url": { + "description": "Image URL", + "type": "string" + }, + "name": { + "description": "Character Name", + "type": "string" + }, + "role": { + "description": "Character's Role", + "type": "string" + }, + "voice_actors": { + "type": "array", + "items": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/mal_url" + }, + { + "properties": { + "image_url": { + "type": "string" + }, + "language": { + "type": "string" + } + }, + "type": "object" + } + ] + } + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "anime search": { + "description": "Anime Search Resource", + "properties": { + "data": { + "description": "The resource that this resource collects.", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/pagination" + }, + { + "$ref": "#/components/schemas/anime" + } + ] + } + }, + "type": "object" + }, + "anime episode": { + "description": "Anime Episode Resource", + "properties": { + "data": { + "properties": { + "mal_id": { + "description": "MyAnimeList ID", + "type": "integer" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "title": { + "description": "Title", + "type": "string" + }, + "title_japanese": { + "description": "Title Japanese", + "type": "string" + }, + "title_romanji": { + "description": "title_romanji", + "type": "string" + }, + "duration": { + "description": "Episode duration in seconds", + "type": "integer" + }, + "aired": { + "description": "Aired Date ISO8601", + "type": "string" + }, + "filler": { + "description": "Filler episode", + "type": "bool" + }, + "recap": { + "description": "Recap episode", + "type": "bool" + }, + "synopsis": { + "description": "Episode Synopsis", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, "anime": { "description": "Anime Resource", "properties": { @@ -323,6 +1211,175 @@ }, "type": "object" }, + "anime staff": { + "description": "Anime Staff Resource", + "properties": { + "data": { + "type": "array", + "items": { + "properties": { + "mal_id": { + "description": "MyAnimeList ID", + "type": "integer" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "name": { + "description": "Name", + "type": "string" + }, + "positions": { + "description": "Staff Positions", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "anime statistics": { + "description": "Anime Statistics Resource", + "properties": { + "data": { + "description": "Transform the resource into an array.", + "properties": { + "watching": { + "description": "Number of users watching the resource", + "type": "integer" + }, + "completed": { + "description": "Number of users who have completed the resource", + "type": "integer" + }, + "on_hold": { + "description": "Number of users who have put the resource on hold", + "type": "integer" + }, + "dropped": { + "description": "Number of users who have dropped the resource", + "type": "integer" + }, + "plan_to_watch": { + "description": "Number of users who have planned to watch the resource", + "type": "integer" + }, + "total": { + "description": "Total number of users who have the resource added to their lists", + "type": "integer" + }, + "scores": { + "description": "Transform the resource into an array.", + "type": "array", + "items": { + "properties": { + "score": { + "description": "The number Score", + "type": "integer" + }, + "votes": { + "description": "Number of votes for this score", + "type": "integer" + }, + "percentage": { + "description": "Percentage of votes for this score", + "type": "float" + } + }, + "type": "object" + } + } + }, + "type": "object" + } + }, + "type": "object" + }, + "anime videos": { + "description": "Anime Videos Resource", + "properties": { + "data": { + "description": "Transform the resource into an array.", + "properties": { + "promos": { + "description": "Transform the resource into an array.", + "type": "array", + "items": { + "properties": { + "title": { + "description": "Title", + "type": "string" + }, + "image_url": { + "description": "Image URL", + "type": "string" + }, + "trailer": { + "$ref": "#/components/schemas/trailer" + } + }, + "type": "object" + } + }, + "episodes": { + "description": "Transform the resource into an array.", + "type": "array", + "items": { + "properties": { + "mal_id": { + "description": "MyAnimeList ID", + "type": "integer" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "title": { + "description": "Title", + "type": "string" + }, + "episode": { + "description": "Episode", + "type": "string" + }, + "image_url": { + "description": "Image URL", + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + } + }, + "type": "object" + }, + "characters search": { + "description": "Characters Search Resource", + "properties": { + "data": { + "description": "The resource that this resource collects.", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/pagination" + }, + { + "$ref": "#/components/schemas/character" + } + ] + } + }, + "type": "object" + }, "character": { "description": "Character Resource", "properties": { @@ -470,6 +1527,31 @@ "embed_url": { "description": "Parsed Embed URL", "type": "string" + }, + "images": { + "properties": { + "image_url": { + "description": "Default Image Size URL (120x90)", + "type": "string" + }, + "small_image_url": { + "description": "Small Image Size URL (640x480)", + "type": "string" + }, + "medium_image_url": { + "description": "Medium Image Size URL (320x180)", + "type": "string" + }, + "large_image_url": { + "description": "Large Image Size URL (480x360)", + "type": "string" + }, + "maximum_image_url": { + "description": "Maximum Image Size URL (1280x720)", + "type": "string" + } + }, + "type": "object" } }, "type": "object" @@ -599,6 +1681,188 @@ "type": "object" } }, + "pagination": { + "properties": { + "last_visible_page": { + "type": "integer" + }, + "has_next_page": { + "type": "bool" + } + }, + "type": "object" + }, + "news": { + "properties": { + "results": { + "type": "array", + "items": { + "properties": { + "mal_id": { + "description": "MyAnimeList ID", + "type": "integer" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "title": { + "description": "Title", + "type": "string" + }, + "date": { + "description": "Post Date ISO8601", + "type": "string" + }, + "author_username": { + "description": "Author MyAnimeList Username", + "type": "string" + }, + "author_url": { + "description": "Author Profile URL", + "type": "string" + }, + "forum_url": { + "description": "Forum topic URL", + "type": "string" + }, + "image_url": { + "description": "Image URL", + "type": "string" + }, + "comments": { + "description": "Comment count", + "type": "integer" + }, + "excerpt": { + "description": "Excerpt", + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "forum": { + "description": "Forum Resource", + "properties": { + "data": { + "description": "Transform the resource into an array.", + "type": "array", + "items": { + "properties": { + "mal_id": { + "description": "MyAnimeList ID", + "type": "integer" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "title": { + "description": "Title", + "type": "string" + }, + "date": { + "description": "Post Date ISO8601", + "type": "string" + }, + "author_username": { + "description": "Author MyAnimeList Username", + "type": "string" + }, + "author_url": { + "description": "Author Profile URL", + "type": "string" + }, + "comments": { + "description": "Comment count", + "type": "integer" + }, + "last_comment": { + "description": "Last comment details", + "properties": { + "url": { + "description": "Last comment URL", + "type": "string" + }, + "author_username": { + "description": "Author MyAnimeList Username", + "type": "string" + }, + "author_url": { + "description": "Author Profile URL", + "type": "string" + }, + "date": { + "description": "Last comment date posted ISO8601", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "manga characters": { + "description": "Manga Characters Resource", + "properties": { + "data": { + "description": "Transform the resource into an array.", + "type": "array", + "items": { + "properties": { + "mal_id": { + "description": "MyAnimeList ID", + "type": "integer" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "image_url": { + "description": "Image URL", + "type": "string" + }, + "name": { + "description": "Character Name", + "type": "string" + }, + "role": { + "description": "Character's Role", + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "manga search": { + "description": "Manga Search Resource", + "properties": { + "data": { + "description": "The resource that this resource collects.", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/pagination" + }, + { + "$ref": "#/components/schemas/manga" + } + ] + } + }, + "type": "object" + }, "manga": { "description": "Manga Resource", "properties": { @@ -772,6 +2036,97 @@ }, "type": "object" }, + "manga statistics": { + "description": "Manga Statistics Resource", + "properties": { + "data": { + "description": "Transform the resource into an array.", + "properties": { + "reading": { + "description": "Number of users reading the resource", + "type": "integer" + }, + "completed": { + "description": "Number of users who have completed the resource", + "type": "integer" + }, + "on_hold": { + "description": "Number of users who have put the resource on hold", + "type": "integer" + }, + "dropped": { + "description": "Number of users who have dropped the resource", + "type": "integer" + }, + "plan_to_read": { + "description": "Number of users who have planned to read the resource", + "type": "integer" + }, + "total": { + "description": "Total number of users who have the resource added to their lists", + "type": "integer" + }, + "scores": { + "description": "Transform the resource into an array.", + "type": "array", + "items": { + "properties": { + "score": { + "description": "The number Score", + "type": "integer" + }, + "votes": { + "description": "Number of votes for this score", + "type": "integer" + }, + "percentage": { + "description": "Percentage of votes for this score", + "type": "float" + } + }, + "type": "object" + } + } + }, + "type": "object" + } + }, + "type": "object" + }, + "moreinfo": { + "description": "More Info Resource", + "properties": { + "data": { + "description": "Transform the resource into an array.", + "properties": { + "moreinfo": { + "description": "Additional information on the entry", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "people search": { + "description": "People Search Resource", + "properties": { + "data": { + "description": "The resource that this resource collects.", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/pagination" + }, + { + "$ref": "#/components/schemas/person" + } + ] + } + }, + "type": "object" + }, "person": { "description": "Person Resource", "properties": { @@ -894,7 +2249,370 @@ } }, "type": "object" + }, + "pictures": { + "description": "Pictures Resource", + "properties": { + "data": { + "description": "Transform the resource into an array.", + "properties": { + "jpg": { + "description": "Transform the resource into an array.", + "type": "array", + "items": { + "properties": { + "image_url": { + "description": "Default JPG Image Size URL", + "type": "string" + }, + "large_image_url": { + "description": "Large JPG Image Size URL", + "type": "string" + } + }, + "type": "object" + } + }, + "webp": { + "description": "Transform the resource into an array.", + "type": "array", + "items": { + "properties": { + "image_url": { + "description": "Default JPG Image Size URL", + "type": "string" + }, + "large_image_url": { + "description": "Large JPG Image Size URL", + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + } + }, + "type": "object" + }, + "recommendations": { + "description": "Recommendations Resource", + "properties": { + "data": { + "description": "Transform the resource into an array.", + "type": "array", + "items": { + "properties": { + "mal_id": { + "description": "Recommended MyAnimeList ID", + "type": "integer" + }, + "url": { + "description": "Recommended MyAnimeList URL", + "type": "string" + }, + "recommendation_url": { + "description": "Recommendation MyAnimeList URL", + "type": "string" + }, + "title": { + "description": "Recommended Entry Title", + "type": "string" + }, + "recommendation_count": { + "description": "Number of users who have recommended this entry", + "type": "integer" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "anime reviews": { + "description": "Anime Reviews Resource", + "properties": { + "data": { + "type": "array", + "items": { + "properties": { + "mal_id": { + "description": "MyAnimeList ID", + "type": "integer" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "type": { + "description": "Entry Type", + "type": "string" + }, + "votes": { + "description": "Number of user votes on the Review", + "type": "integer" + }, + "date": { + "description": "Review created date ISO8601", + "type": "string" + }, + "scores": { + "description": "Review Scores breakdown", + "properties": { + "overall": { + "description": "Overall Score", + "type": "integer" + }, + "story": { + "description": "Story Score", + "type": "integer" + }, + "animation": { + "description": "Animation Score", + "type": "integer" + }, + "sound": { + "description": "Sound Score", + "type": "integer" + }, + "character": { + "description": "Character Score", + "type": "integer" + }, + "enjoyment": { + "description": "Enjoyment Score", + "type": "integer" + } + }, + "type": "object" + }, + "review": { + "description": "Review content", + "type": "string" + }, + "reviewer": { + "description": "Reviewer details", + "properties": { + "username": { + "description": "MyAnimeList Username", + "type": "string" + }, + "url": { + "description": "MyAnimeList Profile URL", + "type": "string" + }, + "image_url": { + "description": "User Display Picture Image URL", + "type": "string" + }, + "episodes_seen": { + "description": "Number of episodes seen", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "manga reviews": { + "description": "Manga Reviews Resource", + "properties": { + "data": { + "type": "array", + "items": { + "properties": { + "mal_id": { + "description": "MyAnimeList ID", + "type": "integer" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "type": { + "description": "Entry Type", + "type": "string" + }, + "votes": { + "description": "Number of user votes on the Review", + "type": "integer" + }, + "date": { + "description": "Review created date ISO8601", + "type": "string" + }, + "scores": { + "description": "Review Scores breakdown", + "properties": { + "overall": { + "description": "Overall Score", + "type": "integer" + }, + "story": { + "description": "Story Score", + "type": "integer" + }, + "art": { + "description": "Art Score", + "type": "integer" + }, + "character": { + "description": "Character Score", + "type": "integer" + }, + "enjoyment": { + "description": "Enjoyment Score", + "type": "integer" + } + }, + "type": "object" + }, + "review": { + "description": "Review content", + "type": "string" + }, + "reviewer": { + "description": "Reviewer details", + "properties": { + "username": { + "description": "MyAnimeList Username", + "type": "string" + }, + "url": { + "description": "MyAnimeList Profile URL", + "type": "string" + }, + "image_url": { + "description": "User Display Picture Image URL", + "type": "string" + }, + "episodes_seen": { + "description": "Number of episodes seen", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "anime userupdates": { + "description": "Anime User Updates Resource", + "properties": { + "data": { + "description": "Transform the resource into an array.", + "type": "array", + "items": { + "properties": { + "username": { + "description": "MyAnimeList Username", + "type": "string" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "image_url": { + "description": "Image URL", + "type": "string" + }, + "score": { + "description": "User Score", + "type": "integer" + }, + "status": { + "description": "User list status", + "type": "string" + }, + "episodes_seen": { + "description": "Number of episodes seen", + "type": "integer" + }, + "episodes_total": { + "description": "Total number of episodes", + "type": "integer" + }, + "date": { + "description": "Last updated date ISO8601", + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "manga userupdates": { + "description": "Manga User Updates Resource", + "properties": { + "data": { + "description": "Transform the resource into an array.", + "type": "array", + "items": { + "properties": { + "username": { + "description": "MyAnimeList Username", + "type": "string" + }, + "url": { + "description": "MyAnimeList URL", + "type": "string" + }, + "image_url": { + "description": "Image URL", + "type": "string" + }, + "score": { + "description": "User Score", + "type": "integer" + }, + "status": { + "description": "User list status", + "type": "string" + }, + "volumes_read": { + "description": "Number of volumes read", + "type": "integer" + }, + "volumes_total": { + "description": "Total number of volumes", + "type": "integer" + }, + "chapters_read": { + "description": "Number of chapters read", + "type": "integer" + }, + "chapters_total": { + "description": "Total number of chapters", + "type": "integer" + }, + "date": { + "description": "Last updated date ISO8601", + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" } } + }, + "externalDocs": { + "description": "Find out more about Jikan", + "url": "https://jikan.moe" } } \ No newline at end of file