File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 1.2.3
4
+ - Register services in bundle extension file
5
+ - Fix exceptions issues
6
+ - Add .gitattributes
7
+
3
8
## 1.2.2
4
9
- Handle deserialization exceptions
5
10
- Update composer.json minimum-stability
Original file line number Diff line number Diff line change 7
7
8
8
- Request data supported: ` json ` , ` xml ` and ` form ` based on header content type.
9
9
- Resolve inputs arguments for controllers actions.
10
+ - Create DTO inputs outside controllers
10
11
- Validate DTO inputs objects.
11
12
- Global YAML configuration.
12
13
- Custom Configuration via Input Attribute per controller action.
@@ -86,7 +87,7 @@ Content-Type: application/problem+json; charset=utf-8
86
87
}
87
88
```
88
89
89
- ### Deserialization (v1.2.2)
90
+ ### Deserialization
90
91
91
92
Whether the request data contains invalid syntax or invalid attributes types a clear 400 json response will return:
92
93
@@ -126,6 +127,34 @@ request_input:
126
127
127
128
You can also override the format using attribute input and specify the format explicitly.
128
129
130
+ ### Create DTO input outside controller
131
+
132
+ You just need to inject ` InputFactoryInterface` e.g:
133
+ ` ` ` php
134
+ <?php
135
+
136
+ declare(strict_types=1);
137
+
138
+ namespace App\M anager;
139
+
140
+ use App\D to\P ostInput;
141
+ use Sfmok\R equestInput\I nputInterface;
142
+ use Symfony\C omponent\H ttpFoundation\R equest;
143
+ use Sfmok\R equestInput\F actory\I nputFactoryInterface;
144
+
145
+ class PostManager
146
+ {
147
+ public function __construct(private InputFactoryInterface $inputFactory)
148
+ {
149
+ }
150
+
151
+ public function getInput(Request $request): InputInterface
152
+ {
153
+ return $this->inputFactory->createFromRequest($request, PostInput::class, 'json');
154
+ }
155
+ }
156
+ ` ` `
157
+
129
158
# # License
130
159
131
160
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
You can’t perform that action at this time.
0 commit comments