1616use Weasel \JsonMarshaller \Config \IAnnotations \IJsonAnyGetter ;
1717use Weasel \JsonMarshaller \Config \IAnnotations \IJsonAnySetter ;
1818use Weasel \JsonMarshaller \Config \IAnnotations \IJsonTypeInfo ;
19+ use Weasel \JsonMarshaller \Utils \TypeParser ;
1920
2021/**
2122 * Load the configuration for a given class from annotations
@@ -137,7 +138,7 @@ protected function _configureGetter(\ReflectionMethod $method, IJsonProperty $pr
137138 throw new \Exception ("Serialization for property of name $ property has already been configured. " );
138139 }
139140 $ getterConfig ->method = $ name ;
140- $ getterConfig ->type = $ propertyConfig ->getType ();
141+ $ getterConfig ->type = TypeParser:: parseType ( $ propertyConfig ->getType (), true );
141142
142143 $ this ->config ->serialization ->properties [$ property ] = $ getterConfig ;
143144 }
@@ -169,7 +170,7 @@ protected function _configureSetter(\ReflectionMethod $method, IJsonProperty $pr
169170 }
170171 $ setterConfig = new Deserialization \SetterDeserialization ();
171172 $ setterConfig ->method = $ name ;
172- $ setterConfig ->type = $ propertyConfig ->getType ();
173+ $ setterConfig ->type = TypeParser:: parseType ( $ propertyConfig ->getType (), true );
173174 $ setterConfig ->typeInfo = $ this ->_getDeserializationTypeInfo ($ typeInfo , $ subTypes );
174175 $ setterConfig ->strict = $ propertyConfig ->getStrict ();
175176
@@ -213,7 +214,7 @@ protected function _configureCreator(\ReflectionMethod $method, IJsonCreator $cr
213214 foreach ($ creatorConfig ->getParams () as $ paramConfig ) {
214215 $ param = new Deserialization \Param ();
215216 $ param ->name = $ paramConfig ->getName ();
216- $ param ->type = $ paramConfig ->getType ();
217+ $ param ->type = TypeParser:: parseType ( $ paramConfig ->getType (), true );
217218 $ param ->strict = $ paramConfig ->getStrict ();
218219 if (!isset ($ param ->name )) {
219220 if (!isset ($ paramNames [$ i ])) {
@@ -284,7 +285,7 @@ protected function _configureProperty(\ReflectionProperty $property)
284285 if (!isset ($ this ->config ->deserialization ->properties [$ propertyName ])) {
285286 $ setterConfig = new Deserialization \DirectDeserialization ();
286287 $ setterConfig ->property = $ name ;
287- $ setterConfig ->type = $ propertyConfig ->getType ();
288+ $ setterConfig ->type = TypeParser:: parseType ( $ propertyConfig ->getType (), true );
288289 $ setterConfig ->typeInfo = $ this ->_getDeserializationTypeInfo ($ typeInfo , $ subTypes );
289290
290291 $ this ->config ->deserialization ->properties [$ propertyName ] = $ setterConfig ;
@@ -294,7 +295,7 @@ protected function _configureProperty(\ReflectionProperty $property)
294295 if (!isset ($ this ->config ->serialization ->properties [$ propertyName ])) {
295296 $ getterConfig = new Serialization \DirectSerialization ();
296297 $ getterConfig ->property = $ name ;
297- $ getterConfig ->type = $ propertyConfig ->getType ();
298+ $ getterConfig ->type = TypeParser:: parseType ( $ propertyConfig ->getType (), true );
298299
299300 /**
300301 * @var Annotations\JsonInclude $includer
0 commit comments