Skip to content

Commit

Permalink
Fix swagger (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
mako321 authored Feb 16, 2024
1 parent aa54547 commit 05252a3
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 94 deletions.
7 changes: 1 addition & 6 deletions src/Http/Controllers/Swagger/ContentApiSwagger.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
* type="string"
* ),
* )
*/

/**
*
*
* @OA\Schema(
* schema="H5PContentList",
Expand Down Expand Up @@ -86,9 +84,6 @@
* ),
* )
*/



interface ContentApiSwagger
{
/**
Expand Down
14 changes: 5 additions & 9 deletions src/Http/Controllers/Swagger/EditorApiSwagger.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ interface EditorApiSwagger
* type="object",
* )
* )
*/

/**
*
*
* @OA\Schema(
* schema="H5PEditorSettings",
Expand Down Expand Up @@ -251,9 +249,8 @@ interface EditorApiSwagger
* type="integer",
* )
* )
*/

/**
*
*
* @OA\Get(
* path="/api/hh5p/editor",
* summary="Editor settings ",
Expand All @@ -268,9 +265,8 @@ interface EditorApiSwagger
* )
* )
* )
*/

/**
*
*
* @OA\Get(
* path="/api/hh5p/editor/{id}",
* summary="Editor settings ",
Expand Down
156 changes: 77 additions & 79 deletions src/Http/Controllers/Swagger/FilesApiSwagger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 05252a3

Please sign in to comment.