You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,46 @@
9
9
10
10
PHP SDK to generate JSON-RPC documentation from symfony constraint
11
11
12
+
See [yoanm/symfony-jsonrpc-params-sf-constraints-doc](https://github.com/yoanm/symfony-jsonrpc-params-sf-constraints-doc) for automatic dependency injection.
13
+
12
14
## How to use
13
15
16
+
Create the transformer :
17
+
```php
18
+
$constraintPayloadDocHelper = new ConstraintPayloadDocHelper();
19
+
20
+
$transformer = new ConstraintToParamsDocTransformer(
21
+
new DocTypeHelper(
22
+
$constraintPayloadDocHelper,
23
+
new TypeGuesser()
24
+
),
25
+
new StringDocHelper(),
26
+
new MinMaxHelper(),
27
+
$constraintPayloadDocHelper
28
+
);
29
+
```
30
+
31
+
Then use it with single constraint or a list of :
32
+
```php
33
+
use Symfony\Component\Validator\Constraints as ConstraintNS;
34
+
use Yoanm\JsonRpcServerDoc\Domain\Model\Type\ObjectDoc;
35
+
use Yoanm\JsonRpcServerDoc\Domain\Model\Type\StringDoc;
0 commit comments