From 79a8a12597e484be52e515c1cb303951075e4aa0 Mon Sep 17 00:00:00 2001 From: Irfan Date: Wed, 27 Jul 2022 21:59:58 +0500 Subject: [PATCH] docs: update --- app/Http/Controllers/V4DB/AnimeController.php | 65 ++++++++-------- storage/api-docs/api-docs.json | 76 +++++++++++++++++++ 2 files changed, 108 insertions(+), 33 deletions(-) diff --git a/app/Http/Controllers/V4DB/AnimeController.php b/app/Http/Controllers/V4DB/AnimeController.php index c4e8518..7715381 100644 --- a/app/Http/Controllers/V4DB/AnimeController.php +++ b/app/Http/Controllers/V4DB/AnimeController.php @@ -731,7 +731,7 @@ class AnimeController extends Controller * * @OA\Response( * response="200", - * description="Returns videos related to the entry", + * description="Returns episode videos related to the entry", * @OA\JsonContent( * ref="#/components/schemas/anime_videos_episodes" * ) @@ -740,6 +740,7 @@ class AnimeController extends Controller * response="400", * description="Error: Bad request. When required parameters were not supplied.", * ), + * ), * * * @OA\Schema( @@ -749,41 +750,40 @@ class AnimeController extends Controller * allOf={ * @OA\Schema(ref="#/components/schemas/pagination"), * @OA\Schema( - * @OA\Property( - * property="data", - * type="array", - * @OA\Items( - * type="object", - * @OA\Property( - * property="mal_id", - * type="integer", - * description="MyAnimeList ID or Episode Number" - * ), - * @OA\Property( - * property="title", - * type="string", - * description="Episode Title" - * ), - * @OA\Property( - * property="episode", - * type="string", - * description="Episode Subtitle" - * ), - * @OA\Property( - * property="url", - * type="string", - * description="Episode Page URL", - * ), - * @OA\Property( - * property="images", - * ref="#/components/schemas/common_images" - * ), + * @OA\Property( + * property="data", + * type="array", + * @OA\Items( + * type="object", + * @OA\Property( + * property="mal_id", + * type="integer", + * description="MyAnimeList ID or Episode Number" + * ), + * @OA\Property( + * property="title", + * type="string", + * description="Episode Title" + * ), + * @OA\Property( + * property="episode", + * type="string", + * description="Episode Subtitle" + * ), + * @OA\Property( + * property="url", + * type="string", + * description="Episode Page URL", + * ), + * @OA\Property( + * property="images", + * ref="#/components/schemas/common_images" + * ), + * ), * ), * ), - * ), * } * ) - * ) */ public function videosEpisodes(Request $request, int $id) { @@ -791,7 +791,6 @@ class AnimeController extends Controller ->where('request_hash', $this->fingerprint) ->get(); - if ( $results->isEmpty() || $this->isExpired($request, $results) diff --git a/storage/api-docs/api-docs.json b/storage/api-docs/api-docs.json index d9e4c4a..1c3f791 100644 --- a/storage/api-docs/api-docs.json +++ b/storage/api-docs/api-docs.json @@ -361,6 +361,42 @@ } } }, + "/anime/{id}/videos/episodes": { + "get": { + "tags": [ + "anime" + ], + "operationId": "getAnimeVideosEpisodes", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/page" + } + ], + "responses": { + "200": { + "description": "Returns episode videos related to the entry", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/anime_videos_episodes" + } + } + } + }, + "400": { + "description": "Error: Bad request. When required parameters were not supplied." + } + } + } + }, "/anime/{id}/pictures": { "get": { "tags": [ @@ -3914,6 +3950,46 @@ } ] }, + "anime_videos_episodes": { + "description": "Anime Videos Episodes Resource", + "allOf": [ + { + "properties": { + "data": { + "type": "array", + "items": { + "properties": { + "mal_id": { + "description": "MyAnimeList ID or Episode Number", + "type": "integer" + }, + "title": { + "description": "Episode Title", + "type": "string" + }, + "episode": { + "description": "Episode Subtitle", + "type": "string" + }, + "url": { + "description": "Episode Page URL", + "type": "string" + }, + "images": { + "$ref": "#/components/schemas/common_images" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/pagination" + } + ] + }, "character_pictures": { "description": "Character Pictures", "properties": {