1010from six import iteritems
1111
1212from openapi_core .exceptions import (
13- InvalidValueType , UndefinedSchemaProperty , MissingPropertyError ,
14- InvalidValue ,
13+ InvalidValueType , UndefinedSchemaProperty , MissingProperty , InvalidValue ,
1514)
1615from openapi_core .models import ModelFactory
1716
@@ -59,7 +58,8 @@ def cast(self, value):
5958 if value is None :
6059 if not self .nullable :
6160 raise InvalidValueType (
62- "Failed to cast value of %s to %s" , value , self .type ,
61+ "Failed to cast value of {0} to {1}" .format (
62+ value , self .type )
6363 )
6464 return self .default
6565
@@ -73,7 +73,7 @@ def cast(self, value):
7373 return cast_callable (value )
7474 except ValueError :
7575 raise InvalidValueType (
76- "Failed to cast value of %s to %s" , value , self .type ,
76+ "Failed to cast value of {0} to {1}" . format ( value , self .type )
7777 )
7878
7979 def unmarshal (self , value ):
@@ -88,7 +88,8 @@ def unmarshal(self, value):
8888
8989 if self .enum and casted not in self .enum :
9090 raise InvalidValue (
91- "Value of %s not in enum choices: %s" , value , str (self .enum ),
91+ "Value of {0} not in enum choices: {1}" .format (
92+ value , self .enum )
9293 )
9394
9495 return casted
@@ -115,7 +116,7 @@ def _unmarshal_object(self, value):
115116 prop_value = value [prop_name ]
116117 except KeyError :
117118 if prop_name in self .required :
118- raise MissingPropertyError (
119+ raise MissingProperty (
119120 "Missing schema property {0}" .format (prop_name ))
120121 if not prop .nullable and not prop .default :
121122 continue
0 commit comments