fix openapi docs

Fixes #232
This commit is contained in:
László GÖRÖG 2022-06-06 22:30:43 +02:00
parent 1bd53a09b0
commit 4ac42b21ec
11 changed files with 343 additions and 267 deletions

View File

@ -484,8 +484,11 @@ class AnimeController extends Controller
* response="200",
* description="Returns a single anime episode resource",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* ref="#/components/schemas/anime_episode"
* )
* )
* ),
* @OA\Response(
* response="400",

View File

@ -39,8 +39,11 @@ class CharacterController extends Controller
* response="200",
* description="Returns complete character resource data",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* ref="#/components/schemas/character_full"
* )
* )
* ),
* @OA\Response(
* response="400",
@ -123,8 +126,11 @@ class CharacterController extends Controller
* response="200",
* description="Returns character resource",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* ref="#/components/schemas/character"
* )
* )
* ),
* @OA\Response(
* response="400",

View File

@ -35,8 +35,11 @@ class ClubController extends Controller
* response="200",
* description="Returns Club Resource",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* ref="#/components/schemas/club"
* )
* )
* ),
* @OA\Response(
* response="400",

View File

@ -64,10 +64,13 @@ class MangaController extends Controller
*
* @OA\Response(
* response="200",
* description="Returns complete anime resource data",
* description="Returns complete manga resource data",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* ref="#/components/schemas/manga_full"
* )
* )
* ),
*
* @OA\Response(
@ -152,8 +155,11 @@ class MangaController extends Controller
* response="200",
* description="Returns pictures related to the entry",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* ref="#/components/schemas/manga"
* )
* )
* ),
*
* @OA\Response(

View File

@ -38,8 +38,11 @@ class PersonController extends Controller
* response="200",
* description="Returns complete character resource data",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* ref="#/components/schemas/person_full"
* )
* )
* ),
*
* @OA\Response(
@ -123,8 +126,11 @@ class PersonController extends Controller
* response="200",
* description="Returns pictures related to the entry",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* ref="#/components/schemas/person"
* )
* )
* ),
*
* @OA\Response(

View File

@ -671,16 +671,26 @@ class SearchController extends Controller
/**
* @OA\Get(
* path="/users/userbyid",
* path="/users/userbyid/{id}",
* operationId="getUserById",
* tags={"users"},
*
* @OA\Parameter(
* name="id",
* in="path",
* required=true,
* @OA\Schema(type="integer")
* ),
*
* @OA\Response(
* response="200",
* description="Returns username by ID search",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* ref="#/components/schemas/user_by_id"
* )
* )
* ),
* @OA\Response(
* response="400",

View File

@ -51,8 +51,11 @@ class UserController extends Controller
* response="200",
* description="Returns complete user resource data",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* ref="#/components/schemas/user_profile_full"
* )
* )
* ),
* @OA\Response(
* response="400",
@ -134,8 +137,11 @@ class UserController extends Controller
* response="200",
* description="Returns user profile",
* @OA\JsonContent(
* @OA\Property(
* property="data",
* ref="#/components/schemas/user_profile"
* )
* )
* ),
* @OA\Response(
* response="400",

View File

@ -12,9 +12,6 @@ class AnimeEpisodeResource extends JsonResource
* description="Anime Episode Resource",
*
* @OA\Property(
* property="data",
* type="object",
* @OA\Property(
* property="mal_id",
* type="integer",
* description="MyAnimeList ID"
@ -69,7 +66,6 @@ class AnimeEpisodeResource extends JsonResource
* description="Episode Synopsis",
* nullable=true
* ),
* ),
* )
*/

View File

@ -17,10 +17,6 @@ class ClubResource extends JsonResource
* description="Club Resource",
*
* @OA\Property(
* property="data",
* type="object",
*
* @OA\Property(
* property="mal_id",
* type="integer",
* description="MyAnimeList ID"
@ -63,7 +59,6 @@ class ClubResource extends JsonResource
* enum={"public", "private", "secret"}
* ),
* ),
* ),
*/
public function toArray($request)
{

View File

@ -373,10 +373,6 @@ class CommonResource extends JsonResource
* description="User Meta By ID",
*
* @OA\Property(
* property="data",
* type="object",
*
* @OA\Property(
* property="url",
* type="string",
* description="MyAnimeList URL"
@ -387,7 +383,6 @@ class CommonResource extends JsonResource
* description="MyAnimeList Username"
* ),
* ),
* ),
*
* @OA\Schema(
* schema="user_images",

View File

@ -229,8 +229,13 @@
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"$ref": "#/components/schemas/anime_episode"
}
},
"type": "object"
}
}
}
},
@ -686,8 +691,13 @@
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"$ref": "#/components/schemas/character_full"
}
},
"type": "object"
}
}
}
},
@ -719,8 +729,13 @@
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"$ref": "#/components/schemas/character"
}
},
"type": "object"
}
}
}
},
@ -884,8 +899,13 @@
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"$ref": "#/components/schemas/club"
}
},
"type": "object"
}
}
}
},
@ -1114,12 +1134,17 @@
],
"responses": {
"200": {
"description": "Returns complete anime resource data",
"description": "Returns complete manga resource data",
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"$ref": "#/components/schemas/manga_full"
}
},
"type": "object"
}
}
}
},
@ -1151,8 +1176,13 @@
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"$ref": "#/components/schemas/manga"
}
},
"type": "object"
}
}
}
},
@ -1578,8 +1608,13 @@
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"$ref": "#/components/schemas/person_full"
}
},
"type": "object"
}
}
}
},
@ -1611,8 +1646,13 @@
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"$ref": "#/components/schemas/person"
}
},
"type": "object"
}
}
}
},
@ -2588,20 +2628,35 @@
}
}
},
"/users/userbyid": {
"/users/userbyid/{id}": {
"get": {
"tags": [
"users"
],
"operationId": "getUserById",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Returns username by ID search",
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"$ref": "#/components/schemas/user_by_id"
}
},
"type": "object"
}
}
}
},
@ -3093,8 +3148,13 @@
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"$ref": "#/components/schemas/user_profile_full"
}
},
"type": "object"
}
}
}
},
@ -3126,8 +3186,13 @@
"content": {
"application/json": {
"schema": {
"properties": {
"data": {
"$ref": "#/components/schemas/user_profile"
}
},
"type": "object"
}
}
}
},
@ -4408,8 +4473,6 @@
},
"anime_episode": {
"description": "Anime Episode Resource",
"properties": {
"data": {
"properties": {
"mal_id": {
"description": "MyAnimeList ID",
@ -4458,9 +4521,6 @@
}
},
"type": "object"
}
},
"type": "object"
},
"anime_full": {
"description": "Full anime Resource",
@ -5372,8 +5432,6 @@
},
"club": {
"description": "Club Resource",
"properties": {
"data": {
"properties": {
"mal_id": {
"description": "MyAnimeList ID",
@ -5427,9 +5485,6 @@
}
},
"type": "object"
}
},
"type": "object"
},
"club_staff": {
"description": "Club Staff Resource",
@ -5764,8 +5819,6 @@
},
"user_by_id": {
"description": "User Meta By ID",
"properties": {
"data": {
"properties": {
"url": {
"description": "MyAnimeList URL",
@ -5777,9 +5830,6 @@
}
},
"type": "object"
}
},
"type": "object"
},
"user_images": {
"properties": {