Skip to content

Commit

Permalink
chevere 4
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Jan 11, 2024
1 parent bfc0ce8 commit 581f985
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
],
"require": {
"php": "^8.1",
"chevere/action": "^1.0.x-dev",
"chevere/action": "^1.0.0",
"chevere/http": "^0.4.x-dev",
"chevere/parameter": "^1.0.x-dev",
"chevere/parameter": "^1.0.0",
"chevere/router": "^0.6.x-dev",
"chevere/schwager": "^0.2.x-dev",
"chevere/standard": "^1.0.x-dev",
Expand Down
6 changes: 3 additions & 3 deletions demo/Controllers/PetGetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
use function Chevere\Parameter\arrayp;
use function Chevere\Parameter\arrayString;
use function Chevere\Parameter\enum;
use function Chevere\Parameter\generic;
use function Chevere\Parameter\int;
use function Chevere\Parameter\iterable;
use function Chevere\Parameter\string;
use function Chevere\Parameter\union;

Expand Down Expand Up @@ -54,11 +54,11 @@ public static function return(): ParameterInterface
name: string(),
photoUrls: union(
arrayp(),
generic(string())
iterable(string())
),
tags: union(
arrayp(),
generic(
iterable(
arrayp(
id: int(),
name: string(),
Expand Down
6 changes: 3 additions & 3 deletions demo/Controllers/PetPutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
use Chevere\Parameter\Interfaces\ParameterInterface;
use function Chevere\Parameter\arrayp;
use function Chevere\Parameter\enum;
use function Chevere\Parameter\generic;
use function Chevere\Parameter\int;
use function Chevere\Parameter\iterable;
use function Chevere\Parameter\null;
use function Chevere\Parameter\string;
use function Chevere\Parameter\union;
Expand All @@ -46,11 +46,11 @@ public static function acceptBody(): ArrayParameterInterface
name: string(),
photoUrls: union(
arrayp(),
generic(string())
iterable(string())
),
tags: union(
arrayp(),
generic(
iterable(
arrayp(
id: int(),
name: string(),
Expand Down
8 changes: 4 additions & 4 deletions demo/Controllers/PetsFindByStatusGetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
use function Chevere\Parameter\arrayp;
use function Chevere\Parameter\arrayString;
use function Chevere\Parameter\enum;
use function Chevere\Parameter\generic;
use function Chevere\Parameter\int;
use function Chevere\Parameter\iterable;
use function Chevere\Parameter\string;
use function Chevere\Parameter\union;

Expand All @@ -46,7 +46,7 @@ public static function return(): ParameterInterface
{
return union(
arrayp(),
generic(
iterable(
arrayp(
id: int(),
category: arrayp(
Expand All @@ -56,11 +56,11 @@ public static function return(): ParameterInterface
name: string(),
photoUrls: union(
arrayp(),
generic(string())
iterable(string())
),
tags: union(
arrayp(),
generic(
iterable(
arrayp(
id: int(),
name: string(),
Expand Down
8 changes: 4 additions & 4 deletions demo/Controllers/PetsFindByTagGetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
use function Chevere\Parameter\arrayp;
use function Chevere\Parameter\arrayString;
use function Chevere\Parameter\enum;
use function Chevere\Parameter\generic;
use function Chevere\Parameter\int;
use function Chevere\Parameter\iterable;
use function Chevere\Parameter\string;
use function Chevere\Parameter\union;

Expand All @@ -46,7 +46,7 @@ public static function return(): ParameterInterface
{
return union(
arrayp(),
generic(
iterable(
arrayp(
id: int(),
category: arrayp(
Expand All @@ -56,11 +56,11 @@ public static function return(): ParameterInterface
name: string(),
photoUrls: union(
arrayp(),
generic(string())
iterable(string())
),
tags: union(
arrayp(),
generic(
iterable(
arrayp(
id: int(),
name: string(),
Expand Down
6 changes: 3 additions & 3 deletions demo/Controllers/PetsPostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
use Chevere\Parameter\Interfaces\ParameterInterface;
use function Chevere\Parameter\arrayp;
use function Chevere\Parameter\enum;
use function Chevere\Parameter\generic;
use function Chevere\Parameter\int;
use function Chevere\Parameter\iterable;
use function Chevere\Parameter\null;
use function Chevere\Parameter\string;
use function Chevere\Parameter\union;
Expand All @@ -46,11 +46,11 @@ public static function acceptBody(): ArrayParameterInterface
name: string(),
photoUrls: union(
arrayp(),
generic(string())
iterable(string())
),
tags: union(
arrayp(),
generic(
iterable(
arrayp(
id: int(),
name: string(),
Expand Down
4 changes: 2 additions & 2 deletions demo/Controllers/StoreInventoryGetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
use Chevere\Http\Header;
use Chevere\Http\Status;
use Chevere\Parameter\Interfaces\ParameterInterface;
use function Chevere\Parameter\generic;
use function Chevere\Parameter\int;
use function Chevere\Parameter\iterable;
use function Chevere\Parameter\string;

#[Description('Returns pet inventories by status')]
Expand All @@ -32,7 +32,7 @@ final class StoreInventoryGetController extends Controller
{
public static function return(): ParameterInterface
{
return generic(
return iterable(
K: string(),
V: int(),
);
Expand Down
4 changes: 2 additions & 2 deletions demo/Controllers/UserCreateWithArrayPostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
use Chevere\Parameter\Interfaces\ArrayParameterInterface;
use Chevere\Parameter\Interfaces\ParameterInterface;
use function Chevere\Parameter\arrayp;
use function Chevere\Parameter\generic;
use function Chevere\Parameter\int;
use function Chevere\Parameter\iterable;
use function Chevere\Parameter\null;
use function Chevere\Parameter\string;

Expand All @@ -36,7 +36,7 @@ final class UserCreateWithArrayPostController extends Controller
public static function acceptBody(): ArrayParameterInterface
{
return arrayp(
input: generic(
input: iterable(
arrayp(
id: int(),
username: string(),
Expand Down
4 changes: 2 additions & 2 deletions demo/Controllers/UserCreateWithListPostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
use Chevere\Parameter\Interfaces\ArrayParameterInterface;
use Chevere\Parameter\Interfaces\ParameterInterface;
use function Chevere\Parameter\arrayp;
use function Chevere\Parameter\generic;
use function Chevere\Parameter\int;
use function Chevere\Parameter\iterable;
use function Chevere\Parameter\null;
use function Chevere\Parameter\string;

Expand All @@ -36,7 +36,7 @@ final class UserCreateWithListPostController extends Controller
public static function acceptBody(): ArrayParameterInterface
{
return arrayp(
input: generic(
input: iterable(
arrayp(
id: int(),
username: string(),
Expand Down
30 changes: 15 additions & 15 deletions demo/output/schwager.html
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-POST fs-5 me-2">POST</
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand All @@ -319,7 +319,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-POST fs-5 me-2">POST</
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand Down Expand Up @@ -405,7 +405,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-PUT fs-5 me-2">PUT</sp
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand All @@ -418,7 +418,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-PUT fs-5 me-2">PUT</sp
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand Down Expand Up @@ -553,7 +553,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-GET fs-5 me-2">GET</sp
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand All @@ -579,7 +579,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-GET fs-5 me-2">GET</sp
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand All @@ -592,7 +592,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-GET fs-5 me-2">GET</sp
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand Down Expand Up @@ -690,7 +690,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-GET fs-5 me-2">GET</sp
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand All @@ -716,7 +716,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-GET fs-5 me-2">GET</sp
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand All @@ -729,7 +729,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-GET fs-5 me-2">GET</sp
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand Down Expand Up @@ -930,7 +930,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-GET fs-5 me-2">GET</sp
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand All @@ -943,7 +943,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-GET fs-5 me-2">GET</sp
-
type: 'array#map'
-
type: generic
type: iterable
parameters:
K:
type: int
Expand Down Expand Up @@ -1190,7 +1190,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-GET fs-5 me-2">GET</sp
<dd class="col-sm-10">Content-Type: application/json</dd>

<dt class="col-sm-2" title="Body">Body</dt>
<dd class="col-sm-10"><pre><code class="language-yaml">type: generic
<dd class="col-sm-10"><pre><code class="language-yaml">type: iterable
parameters:
K:
type: string
Expand Down Expand Up @@ -1584,7 +1584,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-POST fs-5 me-2">POST</
<dd class="col-sm-10"><pre><code class="language-yaml">type: 'array#map'
parameters:
input:
type: generic
type: iterable
parameters:
K:
type: int
Expand Down Expand Up @@ -1679,7 +1679,7 @@ <h4 class="h4 mb-0"><span class="badge http-method method-POST fs-5 me-2">POST</
<dd class="col-sm-10"><pre><code class="language-yaml">type: 'array#map'
parameters:
input:
type: generic
type: iterable
parameters:
K:
type: int
Expand Down
4 changes: 2 additions & 2 deletions tests/src/GetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
use function Chevere\Parameter\arrayString;
use function Chevere\Parameter\date;
use function Chevere\Parameter\float;
use function Chevere\Parameter\generic;
use function Chevere\Parameter\int;
use function Chevere\Parameter\iterable;
use function Chevere\Parameter\null;
use function Chevere\Parameter\string;
use function Chevere\Parameter\time;
Expand Down Expand Up @@ -62,7 +62,7 @@ public static function acceptBody(): ArrayParameterInterface
rate: float(min: 16.5),
hours: int(min: 1, max: 8),
union: union(null(), string()),
generic: generic(
iterable: iterable(
string(),
)
);
Expand Down

0 comments on commit 581f985

Please sign in to comment.