GeezerVison is showing github.com — Cast event to an array when reading · xp-forge/lambda@1a53b92
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: ChangeLog.md +3Lines changed: 3 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,6 +3,9 @@ AWS Lambda change log |
3 | 3 |
|
4 | 4 | ## ?.?.? / ????-??-?? |
5 | 5 |
|
| 6 | +* Fixed issze #31: Event is not always an array (when using JSON library |
| 7 | + 6.0+, see https://github.com/xp-forge/json/pull/18 |
| 8 | + (@thekid) |
6 | 9 | * Fixed issue #29: Implicitly marking parameter as nullable is deprecated |
7 | 10 | (@thekid) |
8 | 11 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: src/main/php/xp/lambda/AwsRunner.class.php +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -62,7 +62,7 @@ public static function main($args) { |
62 | 62 | try { |
63 | 63 | $r= $api->receive('invocation/next'); |
64 | 64 | $context= new Context($r->headers(), $variables); |
65 | | - $event= 0 === $context->payloadLength ? null : Json::read(new StreamInput($r->in())); |
| 65 | + $event= 0 === $context->payloadLength ? null : (array)Json::read(new StreamInput($r->in())); |
66 | 66 |
|
67 | 67 | $lambda->invoke($event, $context); |
68 | 68 | } catch (Throwable $t) { |
|