File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ and this project adheres to
8
8
9
9
## [ Unreleased]
10
10
11
+ ### Fixed
12
+
13
+ - When creating a resource, set the context model prior to field validation
14
+
11
15
## [ 1.0.0-beta.1] - 2023-09-24
12
16
13
17
### Added
Original file line number Diff line number Diff line change @@ -51,13 +51,12 @@ public function handle(Context $context): ?ResponseInterface
51
51
52
52
$ data = $ this ->parseData ($ context );
53
53
54
+ $ context = $ context ->withModel ($ model = $ resource ->newModel ($ context ));
55
+
54
56
$ this ->assertFieldsValid ($ context , $ data );
55
57
$ this ->fillDefaultValues ($ context , $ data );
56
58
$ this ->deserializeValues ($ context , $ data );
57
59
$ this ->assertDataValid ($ context , $ data , true );
58
-
59
- $ context = $ context ->withModel ($ model = $ resource ->newModel ($ context ));
60
-
61
60
$ this ->setValues ($ context , $ data );
62
61
63
62
$ context = $ context ->withModel ($ model = $ resource ->create ($ model , $ context ));
You can’t perform that action at this time.
0 commit comments