Skip to content

Commit 586c598

Browse files
committed
Make sure nested schemas in arrays with no properties are also not hydrated
1 parent 9207301 commit 586c598

File tree

66 files changed

+3251
-700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3251
-700
lines changed

src/Client.php

Lines changed: 109 additions & 4 deletions
Large diffs are not rendered by default.

src/ClientInterface.php

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

src/Hydrator/Operation/Enterprises/CbEnterpriseRcb/AuditLog.php

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
195195
goto after_config;
196196
}
197197

198-
static $configCaster1;
199-
200-
if ($configCaster1 === null) {
201-
$configCaster1 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
202-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
203-
));
204-
}
205-
206-
$value = $configCaster1->cast($value, $this);
207-
208198
$properties['config'] = $value;
209199

210200
after_config:
@@ -216,16 +206,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
216206
goto after_config_was;
217207
}
218208

219-
static $config_wasCaster1;
220-
221-
if ($config_wasCaster1 === null) {
222-
$config_wasCaster1 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
223-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
224-
));
225-
}
226-
227-
$value = $config_wasCaster1->cast($value, $this);
228-
229209
$properties['config_was'] = $value;
230210

231211
after_config_was:
@@ -303,16 +283,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
303283
goto after_events;
304284
}
305285

306-
static $eventsCaster1;
307-
308-
if ($eventsCaster1 === null) {
309-
$eventsCaster1 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
310-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
311-
));
312-
}
313-
314-
$value = $eventsCaster1->cast($value, $this);
315-
316286
$properties['events'] = $value;
317287

318288
after_events:
@@ -324,16 +294,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
324294
goto after_events_were;
325295
}
326296

327-
static $events_wereCaster1;
328-
329-
if ($events_wereCaster1 === null) {
330-
$events_wereCaster1 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
331-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
332-
));
333-
}
334-
335-
$value = $events_wereCaster1->cast($value, $this);
336-
337297
$properties['events_were'] = $value;
338298

339299
after_events_were:
@@ -807,15 +767,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
807767
if ($config === null) {
808768
goto after_config;
809769
}
810-
static $configSerializer0;
811-
812-
if ($configSerializer0 === null) {
813-
$configSerializer0 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
814-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
815-
));
816-
}
817-
818-
$config = $configSerializer0->serialize($config, $this);
819770
after_config: $result['config'] = $config;
820771

821772

@@ -824,15 +775,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
824775
if ($config_was === null) {
825776
goto after_config_was;
826777
}
827-
static $config_wasSerializer0;
828-
829-
if ($config_wasSerializer0 === null) {
830-
$config_wasSerializer0 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
831-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
832-
));
833-
}
834-
835-
$config_was = $config_wasSerializer0->serialize($config_was, $this);
836778
after_config_was: $result['config_was'] = $config_was;
837779

838780

@@ -889,15 +831,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
889831
if ($events === null) {
890832
goto after_events;
891833
}
892-
static $eventsSerializer0;
893-
894-
if ($eventsSerializer0 === null) {
895-
$eventsSerializer0 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
896-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
897-
));
898-
}
899-
900-
$events = $eventsSerializer0->serialize($events, $this);
901834
after_events: $result['events'] = $events;
902835

903836

@@ -906,15 +839,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
906839
if ($events_were === null) {
907840
goto after_events_were;
908841
}
909-
static $events_wereSerializer0;
910-
911-
if ($events_wereSerializer0 === null) {
912-
$events_wereSerializer0 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
913-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
914-
));
915-
}
916-
917-
$events_were = $events_wereSerializer0->serialize($events_were, $this);
918842
after_events_were: $result['events_were'] = $events_were;
919843

920844

src/Hydrator/Operation/Organizations/CbOrganizationIdRcb/CustomRoles.php

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
127127
$value = $payload['base_role'] ?? null;
128128

129129
if ($value === null) {
130-
$missingFields[] = 'base_role';
130+
$properties['base_role'] = null;
131131
goto after_base_role;
132132
}
133133

@@ -138,7 +138,7 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
138138
$value = $payload['permissions'] ?? null;
139139

140140
if ($value === null) {
141-
$missingFields[] = 'permissions';
141+
$properties['permissions'] = null;
142142
goto after_permissions;
143143
}
144144

@@ -149,7 +149,7 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
149149
$value = $payload['organization'] ?? null;
150150

151151
if ($value === null) {
152-
$missingFields[] = 'organization';
152+
$properties['organization'] = null;
153153
goto after_organization;
154154
}
155155

@@ -169,7 +169,7 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
169169
$value = $payload['created_at'] ?? null;
170170

171171
if ($value === null) {
172-
$missingFields[] = 'created_at';
172+
$properties['created_at'] = null;
173173
goto after_created_at;
174174
}
175175

@@ -180,7 +180,7 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
180180
$value = $payload['updated_at'] ?? null;
181181

182182
if ($value === null) {
183-
$missingFields[] = 'updated_at';
183+
$properties['updated_at'] = null;
184184
goto after_updated_at;
185185
}
186186

@@ -607,10 +607,18 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
607607

608608

609609
$base_role = $object->base_role;
610+
611+
if ($base_role === null) {
612+
goto after_base_role;
613+
}
610614
after_base_role: $result['base_role'] = $base_role;
611615

612616

613617
$permissions = $object->permissions;
618+
619+
if ($permissions === null) {
620+
goto after_permissions;
621+
}
614622
static $permissionsSerializer0;
615623

616624
if ($permissionsSerializer0 === null) {
@@ -623,15 +631,27 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
623631

624632

625633
$organization = $object->organization;
634+
635+
if ($organization === null) {
636+
goto after_organization;
637+
}
626638
$organization = $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️SimpleUser($organization);
627639
after_organization: $result['organization'] = $organization;
628640

629641

630642
$created_at = $object->created_at;
643+
644+
if ($created_at === null) {
645+
goto after_created_at;
646+
}
631647
after_created_at: $result['created_at'] = $created_at;
632648

633649

634650
$updated_at = $object->updated_at;
651+
652+
if ($updated_at === null) {
653+
goto after_updated_at;
654+
}
635655
after_updated_at: $result['updated_at'] = $updated_at;
636656

637657

src/Hydrator/Operation/Orgs/CbOrgRcb/AuditLog.php

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
195195
goto after_config;
196196
}
197197

198-
static $configCaster1;
199-
200-
if ($configCaster1 === null) {
201-
$configCaster1 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
202-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
203-
));
204-
}
205-
206-
$value = $configCaster1->cast($value, $this);
207-
208198
$properties['config'] = $value;
209199

210200
after_config:
@@ -216,16 +206,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
216206
goto after_config_was;
217207
}
218208

219-
static $config_wasCaster1;
220-
221-
if ($config_wasCaster1 === null) {
222-
$config_wasCaster1 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
223-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
224-
));
225-
}
226-
227-
$value = $config_wasCaster1->cast($value, $this);
228-
229209
$properties['config_was'] = $value;
230210

231211
after_config_was:
@@ -303,16 +283,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
303283
goto after_events;
304284
}
305285

306-
static $eventsCaster1;
307-
308-
if ($eventsCaster1 === null) {
309-
$eventsCaster1 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
310-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
311-
));
312-
}
313-
314-
$value = $eventsCaster1->cast($value, $this);
315-
316286
$properties['events'] = $value;
317287

318288
after_events:
@@ -324,16 +294,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
324294
goto after_events_were;
325295
}
326296

327-
static $events_wereCaster1;
328-
329-
if ($events_wereCaster1 === null) {
330-
$events_wereCaster1 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
331-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
332-
));
333-
}
334-
335-
$value = $events_wereCaster1->cast($value, $this);
336-
337297
$properties['events_were'] = $value;
338298

339299
after_events_were:
@@ -807,15 +767,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
807767
if ($config === null) {
808768
goto after_config;
809769
}
810-
static $configSerializer0;
811-
812-
if ($configSerializer0 === null) {
813-
$configSerializer0 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
814-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
815-
));
816-
}
817-
818-
$config = $configSerializer0->serialize($config, $this);
819770
after_config: $result['config'] = $config;
820771

821772

@@ -824,15 +775,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
824775
if ($config_was === null) {
825776
goto after_config_was;
826777
}
827-
static $config_wasSerializer0;
828-
829-
if ($config_wasSerializer0 === null) {
830-
$config_wasSerializer0 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
831-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
832-
));
833-
}
834-
835-
$config_was = $config_wasSerializer0->serialize($config_was, $this);
836778
after_config_was: $result['config_was'] = $config_was;
837779

838780

@@ -889,15 +831,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
889831
if ($events === null) {
890832
goto after_events;
891833
}
892-
static $eventsSerializer0;
893-
894-
if ($eventsSerializer0 === null) {
895-
$eventsSerializer0 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
896-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
897-
));
898-
}
899-
900-
$events = $eventsSerializer0->serialize($events, $this);
901834
after_events: $result['events'] = $events;
902835

903836

@@ -906,15 +839,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
906839
if ($events_were === null) {
907840
goto after_events_were;
908841
}
909-
static $events_wereSerializer0;
910-
911-
if ($events_wereSerializer0 === null) {
912-
$events_wereSerializer0 = new \EventSauce\ObjectHydrator\PropertyCasters\CastListToType(...array (
913-
0 => 'ApiClients\\Client\\GitHubEnterpriseCloud\\Schema\\AuditLogEvent\\Config',
914-
));
915-
}
916-
917-
$events_were = $events_wereSerializer0->serialize($events_were, $this);
918842
after_events_were: $result['events_were'] = $events_were;
919843

920844

0 commit comments

Comments
 (0)