Skip to content

Commit 4e753bd

Browse files
committed
[#522] Align DemoApi OpenAPI auth/account/post contracts and spec path checks
1 parent 956254b commit 4e753bd

4 files changed

Lines changed: 11 additions & 13 deletions

File tree

src/Console/Commands/OpenApiCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function exec(): void
126126
return;
127127
}
128128

129-
if (request()->routeGroupExists('openapi', $module) && $this->fs->exists($modulePath . DS . 'resources' . DS . 'openApi' . DS . 'spec.json')) {
129+
if (request()->routeGroupExists('openapi', $module) && $this->fs->exists($modulePath . DS . 'resources' . DS . 'openapi' . DS . 'spec.json')) {
130130
$this->error('The Open API specifications already installed for `' . ucfirst($module) . '` module');
131131
return;
132132
}

src/Module/Templates/DemoApi/src/Controllers/OpenApi/OpenApiAccountController.php.tpl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ abstract class OpenApiAccountController extends OpenApiController
7070
* @OA\MediaType(
7171
* mediaType="application/json",
7272
* @OA\Schema(
73-
* required={"current_password", "new_password", "repeat_password"},
73+
* required={"current_password", "new_password", "confirm_password"},
7474
* @OA\Property(property="current_password", type="string"),
7575
* @OA\Property(property="new_password", type="string"),
76-
* @OA\Property(property="repeat_password", type="string"),
77-
* example={"current_password": "oldPassword", "new_password": "newPassword", "repeat_password": "newPassword"}
76+
* @OA\Property(property="confirm_password", type="string"),
77+
* example={"current_password": "oldPassword", "new_password": "newPassword", "confirm_password": "newPassword"}
7878
* )
7979
* )
8080
* ),
@@ -95,4 +95,3 @@ abstract class OpenApiAccountController extends OpenApiController
9595
}
9696

9797

98-

src/Module/Templates/DemoApi/src/Controllers/OpenApi/OpenApiAuthController.php.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,10 @@ abstract class OpenApiAuthController extends OpenApiController
220220
* @OA\MediaType(
221221
* mediaType="application/json",
222222
* @OA\Schema(
223-
* required={"password"},
223+
* required={"password", "repeat_password"},
224224
* @OA\Property(property="password", type="string"),
225-
* example={"password": "password"}
225+
* @OA\Property(property="repeat_password", type="string"),
226+
* example={"password": "password", "repeat_password": "password"}
226227
* )
227228
* )
228229
* ),
@@ -305,4 +306,3 @@ abstract class OpenApiAuthController extends OpenApiController
305306
}
306307

307308

308-

src/Module/Templates/DemoApi/src/Controllers/OpenApi/OpenApiPostController.php.tpl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ abstract class OpenApiPostController extends OpenApiController
105105
* @OA\Response(response=500, description="Internal Server Error")
106106
* )
107107
*/
108-
abstract public function post(?string $lang, string $postId);
108+
abstract public function post(?string $lang, string $uuid);
109109

110110
/**
111111
* Get my posts action
@@ -234,7 +234,7 @@ abstract class OpenApiPostController extends OpenApiController
234234
* @OA\Response(response=500, description="Internal Server Error")
235235
* )
236236
*/
237-
abstract public function amend(Request $request, ?string $lang, string $postId);
237+
abstract public function amend(Request $request, ?string $lang, string $uuid);
238238

239239
/**
240240
* Delete post action
@@ -258,7 +258,7 @@ abstract class OpenApiPostController extends OpenApiController
258258
* @OA\Response(response=500, description="Internal Server Error")
259259
* )
260260
*/
261-
abstract public function delete(?string $lang, string $postId);
261+
abstract public function delete(?string $lang, string $uuid);
262262

263263
/**
264264
* Delete post image action
@@ -282,8 +282,7 @@ abstract class OpenApiPostController extends OpenApiController
282282
* @OA\Response(response=500, description="Internal Server Error")
283283
* )
284284
*/
285-
abstract public function deleteImage(?string $lang, string $postId);
285+
abstract public function deleteImage(?string $lang, string $uuid);
286286
}
287287

288288

289-

0 commit comments

Comments
 (0)