Skip to content

Commit 95be011

Browse files
committed
fix: swagger response structure fixes
1 parent 90c0186 commit 95be011

5 files changed

Lines changed: 11 additions & 33 deletions

File tree

views/controller/destroy.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @OA\Response(
1717
* response=200,
1818
* description="successful operation",
19-
* @OA\Schema(
19+
* @OA\JsonContent(
2020
* type="object",
2121
* @OA\Property(
2222
* property="success",

views/controller/index.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @OA\Response(
88
* response=200,
99
* description="successful operation",
10-
* @OA\Schema(
10+
* @OA\JsonContent(
1111
* type="object",
1212
* @OA\Property(
1313
* property="success",
@@ -16,7 +16,7 @@
1616
* @OA\Property(
1717
* property="data",
1818
* type="array",
19-
* @OA\Items(ref="#/definitions/{{ $config->modelNames->name }}")
19+
* @OA\Items(ref="#/components/schemas/{{ $config->modelNames->name }}")
2020
* ),
2121
* @OA\Property(
2222
* property="message",

views/controller/show.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
* @OA\Response(
1717
* response=200,
1818
* description="successful operation",
19-
* @OA\Schema(
19+
* @OA\JsonContent(
2020
* type="object",
2121
* @OA\Property(
2222
* property="success",
2323
* type="boolean"
2424
* ),
2525
* @OA\Property(
2626
* property="data",
27-
* ref="#/definitions/{{ $config->modelNames->name }}"
27+
* ref="#/components/schemas/{{ $config->modelNames->name }}"
2828
* ),
2929
* @OA\Property(
3030
* property="message",

views/controller/store.blade.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,20 @@
66
* description="Create {{ $config->modelNames->name }}",
77
* @OA\RequestBody(
88
* required=true,
9-
* @OA\MediaType(
10-
* mediaType="application/x-www-form-urlencoded",
11-
* @OA\Schema(
12-
* type="object",
13-
* required={""},
14-
* @OA\Property(
15-
* property="name",
16-
* description="desc",
17-
* type="string"
18-
* )
19-
* )
20-
* )
9+
* @OA\JsonContent(ref="#/components/schemas/{{ $config->modelNames->name }}")
2110
* ),
2211
* @OA\Response(
2312
* response=200,
2413
* description="successful operation",
25-
* @OA\Schema(
14+
* @OA\JsonContent(
2615
* type="object",
2716
* @OA\Property(
2817
* property="success",
2918
* type="boolean"
3019
* ),
3120
* @OA\Property(
3221
* property="data",
33-
* ref="#/definitions/{{ $config->modelNames->name }}"
22+
* ref="#/components/schemas/{{ $config->modelNames->name }}"
3423
* ),
3524
* @OA\Property(
3625
* property="message",

views/controller/update.blade.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,20 @@
1515
* ),
1616
* @OA\RequestBody(
1717
* required=true,
18-
* @OA\MediaType(
19-
* mediaType="application/x-www-form-urlencoded",
20-
* @OA\Schema(
21-
* type="object",
22-
* required={""},
23-
* @OA\Property(
24-
* property="name",
25-
* description="desc",
26-
* type="string"
27-
* )
28-
* )
29-
* )
18+
* @OA\JsonContent(ref="#/components/schemas/{{ $config->modelNames->name }}")
3019
* ),
3120
* @OA\Response(
3221
* response=200,
3322
* description="successful operation",
34-
* @OA\Schema(
23+
* @OA\JsonContent(
3524
* type="object",
3625
* @OA\Property(
3726
* property="success",
3827
* type="boolean"
3928
* ),
4029
* @OA\Property(
4130
* property="data",
42-
* ref="#/definitions/{{ $config->modelNames->name }}"
31+
* ref="#/components/schemas/{{ $config->modelNames->name }}"
4332
* ),
4433
* @OA\Property(
4534
* property="message",

0 commit comments

Comments
 (0)