@@ -108,7 +108,7 @@ public function normalize($object, $format = null, array $context = [])
108108 $ data ['ID ' ] = $ object ->getID ();
109109 }
110110 if ($ object ->isInitialized ('version ' ) && null !== $ object ->getVersion ()) {
111- $ data ['Version ' ] = $ this ->normalizer ->normalize ($ object ->getVersion (), 'json ' , $ context );
111+ $ data ['Version ' ] = null === $ object -> getVersion () ? null : new \ ArrayObject ( $ this ->normalizer ->normalize ($ object ->getVersion (), 'json ' , $ context), \ArrayObject:: ARRAY_AS_PROPS );
112112 }
113113 if ($ object ->isInitialized ('createdAt ' ) && null !== $ object ->getCreatedAt ()) {
114114 $ data ['CreatedAt ' ] = $ object ->getCreatedAt ();
@@ -117,15 +117,15 @@ public function normalize($object, $format = null, array $context = [])
117117 $ data ['UpdatedAt ' ] = $ object ->getUpdatedAt ();
118118 }
119119 if ($ object ->isInitialized ('spec ' ) && null !== $ object ->getSpec ()) {
120- $ data ['Spec ' ] = $ this ->normalizer ->normalize ($ object ->getSpec (), 'json ' , $ context );
120+ $ data ['Spec ' ] = null === $ object -> getSpec () ? null : new \ ArrayObject ( $ this ->normalizer ->normalize ($ object ->getSpec (), 'json ' , $ context), \ArrayObject:: ARRAY_AS_PROPS );
121121 }
122122 if ($ object ->isInitialized ('info ' ) && null !== $ object ->getInfo ()) {
123- $ data ['Info ' ] = $ this ->normalizer ->normalize ($ object ->getInfo (), 'json ' , $ context );
123+ $ data ['Info ' ] = null === $ object -> getInfo () ? null : new \ ArrayObject ( $ this ->normalizer ->normalize ($ object ->getInfo (), 'json ' , $ context), \ArrayObject:: ARRAY_AS_PROPS );
124124 }
125125 if ($ object ->isInitialized ('publishStatus ' ) && null !== $ object ->getPublishStatus ()) {
126126 $ values = [];
127127 foreach ($ object ->getPublishStatus () as $ value ) {
128- $ values [] = $ this ->normalizer ->normalize ($ value , 'json ' , $ context );
128+ $ values [] = null === $ value ? null : new \ ArrayObject ( $ this ->normalizer ->normalize ($ value , 'json ' , $ context), \ArrayObject:: ARRAY_AS_PROPS );
129129 }
130130 $ data ['PublishStatus ' ] = $ values ;
131131 }
0 commit comments