From 05252a3a03d4844b51cb89ff5aa37c80a1708831 Mon Sep 17 00:00:00 2001 From: Maciej Rymarz <59456825+mako321@users.noreply.github.com> Date: Fri, 16 Feb 2024 12:53:29 +0100 Subject: [PATCH] Fix swagger (#200) --- .../Controllers/Swagger/ContentApiSwagger.php | 7 +- .../Controllers/Swagger/EditorApiSwagger.php | 14 +- .../Controllers/Swagger/FilesApiSwagger.php | 156 +++++++++--------- 3 files changed, 83 insertions(+), 94 deletions(-) diff --git a/src/Http/Controllers/Swagger/ContentApiSwagger.php b/src/Http/Controllers/Swagger/ContentApiSwagger.php index bca44aa9..aed1cb09 100644 --- a/src/Http/Controllers/Swagger/ContentApiSwagger.php +++ b/src/Http/Controllers/Swagger/ContentApiSwagger.php @@ -32,9 +32,7 @@ * type="string" * ), * ) - */ - - /** + * * * @OA\Schema( * schema="H5PContentList", @@ -86,9 +84,6 @@ * ), * ) */ - - - interface ContentApiSwagger { /** diff --git a/src/Http/Controllers/Swagger/EditorApiSwagger.php b/src/Http/Controllers/Swagger/EditorApiSwagger.php index ce48cf60..e020521d 100644 --- a/src/Http/Controllers/Swagger/EditorApiSwagger.php +++ b/src/Http/Controllers/Swagger/EditorApiSwagger.php @@ -77,9 +77,7 @@ interface EditorApiSwagger * type="object", * ) * ) - */ - - /** + * * * @OA\Schema( * schema="H5PEditorSettings", @@ -251,9 +249,8 @@ interface EditorApiSwagger * type="integer", * ) * ) - */ - - /** + * + * * @OA\Get( * path="/api/hh5p/editor", * summary="Editor settings ", @@ -268,9 +265,8 @@ interface EditorApiSwagger * ) * ) * ) - */ - - /** + * + * * @OA\Get( * path="/api/hh5p/editor/{id}", * summary="Editor settings ", diff --git a/src/Http/Controllers/Swagger/FilesApiSwagger.php b/src/Http/Controllers/Swagger/FilesApiSwagger.php index 36729601..65aa54a6 100644 --- a/src/Http/Controllers/Swagger/FilesApiSwagger.php +++ b/src/Http/Controllers/Swagger/FilesApiSwagger.php @@ -10,84 +10,82 @@ interface FilesApiSwagger { /** - * @OA\Schema( - * schema="H5PContentFile", - * type="object", - * @OA\Property( - * property="file", - * description="file uploaded by h5peditor", - * type="file", - * format="binary" - * ), - * @OA\Property( - * property="field", - * description="json description of file", - * type="string", - * format="string" - * ), - * @OA\Property( - * property="contentId", - * description="id of content", - * type="string", - * format="string" - * ) - * ) - */ + * @OA\Schema( + * schema="H5PContentFile", + * type="object", + * @OA\Property( + * property="file", + * description="file uploaded by h5peditor", + * type="file", + * format="binary" + * ), + * @OA\Property( + * property="field", + * description="json description of file", + * type="string", + * format="string" + * ), + * @OA\Property( + * property="contentId", + * description="id of content", + * type="string", + * format="string" + * ) + * ) + * + * + * @OA\Post( + * path="/api/hh5p/files", + * summary="Store h5p files for h5p editor", + * tags={"H5P"}, + * description="Store h5p files for h5p editor", + * @OA\RequestBody( + * required=true, + * @OA\MediaType( + * mediaType="multipart/form-data", + * @OA\Schema(ref="#/components/schemas/H5PContentFile") + * ) + * ), + * @OA\Response( + * response=200, + * description="successful operation", + * @OA\MediaType( + * mediaType="application/json" + * ) + * ) + * ) + * + * + * @OA\Post( + * path="/api/hh5p/files/{nonce}", + * summary="Store h5p files for h5p editor", + * tags={"H5P"}, + * description="Store h5p files for h5p editor", + * @OA\Parameter( + * name="nonce", + * description="nonce of current editing file", + * in="path", + * required=true, + * @OA\Schema( + * type="string", + * ) + * ), + * @OA\RequestBody( + * required=true, + * @OA\MediaType( + * mediaType="multipart/form-data", + * @OA\Schema(ref="#/components/schemas/H5PContentFile") + * ) + * ), + * @OA\Response( + * response=200, + * description="successful operation", + * @OA\MediaType( + * mediaType="application/json" + * ) + * ) + * ) + */ - /** - * @OA\Post( - * path="/api/hh5p/files", - * summary="Store h5p files for h5p editor", - * tags={"H5P"}, - * description="Store h5p files for h5p editor", - * @OA\RequestBody( - * required=true, - * @OA\MediaType( - * mediaType="multipart/form-data", - * @OA\Schema(ref="#/components/schemas/H5PContentFile") - * ) - * ), - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\MediaType( - * mediaType="application/json" - * ) - * ) - * ) - */ - - /** - * @OA\Post( - * path="/api/hh5p/files/{nonce}", - * summary="Store h5p files for h5p editor", - * tags={"H5P"}, - * description="Store h5p files for h5p editor", - * @OA\Parameter( - * name="nonce", - * description="nonce of current editing file", - * in="path", - * required=true, - * @OA\Schema( - * type="string", - * ) - * ), - * @OA\RequestBody( - * required=true, - * @OA\MediaType( - * mediaType="multipart/form-data", - * @OA\Schema(ref="#/components/schemas/H5PContentFile") - * ) - * ), - * @OA\Response( - * response=200, - * description="successful operation", - * @OA\MediaType( - * mediaType="application/json" - * ) - * ) - * ) - */ - - public function __invoke(FilesStoreRequest $request, String $nonce = null): JsonResponse; + public function __invoke(FilesStoreRequest $request, string $nonce = null): JsonResponse; }