@@ -145,7 +145,7 @@ def __new__(cls, **props):
145145 else : # We got nothing
146146 raise validators .ValidationError (
147147 "Unable to instantiate any valid types: \n "
148- "\n " .join ("{0}: {1}" .format (k , e ) for k , e in validation_errors )
148+ "" .join ("{0}: {1}\n " .format (k , e ) for k , e in validation_errors )
149149 )
150150
151151 return obj
@@ -314,7 +314,7 @@ def __call__(self, *a, **kw):
314314 else : # We got nothing
315315 raise validators .ValidationError (
316316 "Unable to instantiate any valid types: \n "
317- "\n " .join ("{0}: {1}" .format (k , e ) for k , e in validation_errors )
317+ "" .join ("{0}: {1}\n " .format (k , e ) for k , e in validation_errors )
318318 )
319319
320320
@@ -474,6 +474,18 @@ def _construct(self, uri, clsdata, parent=(ProtocolBase,)):
474474 ** clsdata_copy )
475475 return self .resolved [uri ]
476476
477+ elif isinstance (clsdata .get ('type' ), list ):
478+ types = []
479+ for i , item_detail in enumerate (clsdata ['type' ]):
480+ subdata = {k : v for k , v in six .iteritems (clsdata ) if k != 'type' }
481+ subdata ['type' ] = item_detail
482+ types .append (self ._build_literal (
483+ uri + "_%s" % i ,
484+ subdata ))
485+
486+ self .resolved [uri ] = TypeProxy (types )
487+ return self .resolved [uri ]
488+
477489 elif (clsdata .get ('type' , None ) == 'object' or
478490 clsdata .get ('properties' , None ) is not None or
479491 clsdata .get ('additionalProperties' , False )):
@@ -770,6 +782,10 @@ def setprop(self, val):
770782 val = info ['type' ](** util .coerce_for_expansion (val ))
771783
772784 val .validate ()
785+
786+ elif isinstance (info ['type' ], TypeProxy ):
787+ val = info ['type' ](val )
788+
773789 elif info ['type' ] is None :
774790 # This is the null value
775791 if val is not None :
0 commit comments